I am trying to set the request type field value in JIRA service desk request using C sharp code as shown below.
<pre>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace JiraConsoleApp
{
class Program
{
static void Main(string[] args)
{
Jira objJira = new Jira();
objJira.JiraUrl = "https://xxxx.atlassian.net";
objJira.JiraJson = @"{""fields"":{
""project"": {""key"": ""xxxx""},
""issuetype"": {""name"": ""Incident""},
""serviceDeskId"": ""1"",
""requestTypeId"": ""1"",
""requestFieldValues"": {
""summary"": ""This is an automated ticket for Testing"",
""description"": ""Test - ignore this""
}
}}";
objJira.JiraUserName = "xxxxx";
objJira.JiraPassword = "jkl;UIOP&*()";
Console.WriteLine(objJira.addJiraIssue());
Console.ReadKey();
}
}
}
And not sure if I am the way I have declared the value for
serviceDeskId and
requestTypeId is correct when I try to create a normal issue in JIRA it seems to work fine but when setting the service desk and request type id's I am getting the error saying its a unknown error.
Please help me find the issue on how the fields serviceDeskId and requestTypeId needs to be declared.
What I have tried:
I have tried a similar meta data using REST client and it seems to work fine without any issues
{
"serviceDeskId": "1",
"requestTypeId": "1",
"requestFieldValues": {
"summary": "Request JSD help via REST1",
"description": "I need a new mouse for my Mac"
}
}