Dynamically creating Issue Object depending up on the project To create issue

Rajasekhar Katakam March 20, 2018

I am developing the Web API which calls  jira rest api to creates Issue,subtasks etc. In our company's jira domain there are around 200 projects. Each Project is configured with different default screens. So i had created one issue object and passed the Json object as below to create issue in jira. It works for the MFS Project.

JSON :

{

"fields":
{
"project":
{
"key": "MFS"
},

"summary": "Test Jira Integration API --Testing New XtremeJira Interface",
"description": "DonTest Jira Integration API ",
"issuetype":
{
"name": "Defect"
},
"fixVersions": [{

"name": "MFS 15.1.0"

}, {

"name": "MFS 15.6.2"
}],
"customfield_10182":"1002",
"priority": {

"name": "Major",
"id": "3"
},
"versions": [{

"name": "MFS 15.1.0"
}, {



"name": "MFS 15.6.2"
}],
"assignee": {

"name": "kartik"
},
"components": [],
"environment": ""
}

}

But for other project i am getting error message like 

{
"errorMessages ": [],
"errors ": {
"customfield_10182": "Field 'customfield_10182' cannot be set. It is not on the appropriate screen, or unknown. ",
"environment": "Field 'environment' cannot be set. It is not on the appropriate screen, or unknown. "
}
}

So i want to handle this issue across all the project with single Issue object that should generate dynamically depending up on eact project fields for creating issue. 

Creating the issue object for each project  (like if there are 200 projects in our jira domain -creating issue class with fields of each project ) is not good design .

Can Any One please help me on this. I am developing this in .Net Web Api(c# language)

1 answer

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2018

 I guess, if you want to have a singe REST API call, then you have to create your own endpoint. I am not sure, but I think there was a possibility to pass a skip screen check parameter to the REST endpoint. But I was not able to find any mention about it. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events