Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to set the request type field value in JIRA service desk request using C sharp code as shown below.
C#
<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"
}
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900