Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

[API integration] Is there a standard data format to create issue

Rahul Sagore
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 26, 2018

I am creating a form to allow user to create issue in Jira from my website. 

I am checking the request form on this page:

https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-issueLinkType-get

And found following format:

"fields": {
     "project": {
        "id": "10000"
      },
"assignee": { "name": "homer" }
"timetracking": { "originalEstimate": "10", "remainingEstimate": "5" }
}

Now here project takes `id` as key, assignee takes `name`, timetracking taking multiple keys.

How can I decide what to send in request? Either there should be standard format like, sending only ids. Or provide in API that what format this field should be sent to.

Also for custom field, format is different:

"customfield_30000": [
     "10000",
      "10002"
 ],
 "customfield_80000": {
     "value": "red"
  },
  "customfield_20000": "06/Jul/11 3:25 PM",

For some it is taking array, and object with key value, and even string.

 

This the response of my custom field radio button:

Screen Shot 2018-06-26 at 3.11.33 PM.png

 

Here I don't know how should I send my radio values. As object like:

"customfield_80000": {
     "id": "customfield_80000"
  }

Or as array values, or id as string.

 

I need to write some generic code to handle all the possible fields.

 

1 answer

0 votes
Warren
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.
June 26, 2018

Hi

 

Have a look at this document, you can get the meta data

Rahul Sagore
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 26, 2018

I am already getting the meta data for fields. Check devtool screenshot attached in above description.

My issue is while sending the user inputs to jira to create issue, there is no fix format.

Like for project field it is accepting {id: }, for assignee {name:}. How will I know that which key name should I send. (Id or name). Or which type of data should I send for fields (Array or Object).

How can I write some generic code to send user entered data to JIRA? 

Plus there are so many fields including custom fields as well. 

Suggest an answer

Log in or Sign up to answer