Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Constructing payloads for creating and updating issues using v3 api.

Abhinandan G
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!
January 19, 2025

I want to create and update issues from my app using v3 api's for it but I am quite confused here regarding the payload construction. I used this api "rest/api/3/field" to fetch the details of the fields in my project, in that let's consider two of the fields one is "summary" and the other one is "description". 


{
"id": "description",
"key": "description",
"name": "Description",
"custom": false,
"orderable": true,
"navigable": true,
"searchable": true,
"clauseNames": [
"description"
],
"schema": {
"type": "string",
"system": "description"
}
}

{
"id": "summary",
"key": "summary",
"name": "Summary",
"custom": false,
"orderable": true,
"navigable": true,
"searchable": true,
"clauseNames": [
"summary"
],
"schema": {
"type": "string",
"system": "summary"
}

Here you can see the schema type of both the fields is "string". But in the sample payload for creating an issue they have provided the payload type like this


"description": { "content": [ { "content": [ { "text": "Order entry fails when selecting supplier.", "type": "text" } ], "type": "paragraph" } ], "type": "doc", "version": 1 },

"summary": 
"Main order flow broken",

Even though the both types are string, their structure differs. The description and summary are necessary fields so that I can hard code them for constructing the payload, but what about for other fields and custom fields, how can I know their payload structure correctly and construct them? Is there any way I could do that, I have to be able to assign values to all fields which I have in my jira account from my app.

2 answers

1 vote
Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2025

Hi @Abhinandan G 

"Description" is a Rich Text field, thus it needs the addition entry to format it accordingly. Ref: https://community.developer.atlassian.com/t/how-to-edit-the-rich-text-section-in-a-jira-version-via-rest-api/81737/2

"Summary" on the other hand is plain text and doesn't need that additional formatting.

For the questions "how can I know their payload structure correctly and construct them?", I would recommend using one test ticket and updating all the fields via the Jira UI once, and capture the network response. You can use that response structure directly in your API call in the subsequent API's then.

0 votes
Gerusa Lobo _e-Core_
Atlassian Partner
January 20, 2025 edited

Hi @Abhinandan G

To create issues, I use the endpoint APIv3:

https://yoursite.atlassian.net/rest/api/3/issue/

and, the payload that I've tested here using this format:

{
     "fields": {
            "project": {
                 "key": "MOBL"
             },
           "summary": "Gerusa Teste",
           "description": {
                 "content": [
                      {
                          "content": [
                                {
                                    "text": "Teste 123.",
                                    "type": "text"
                                }
                           ],
                           "type": "paragraph"
                      }
                  ],
                 "type": "doc",
                 "version": 1
           },
        "issuetype": {
                "name": "Story"
              } 
         }
}

 

Gerusa Lobo _e-Core_
Atlassian Partner
January 20, 2025 edited

In API v3, the issue descriptions and comments have this new format:

"description": {
                 "content": [
                      {
                          "content": [
                                {
                                    "text": "Teste 123.",
                                    "type": "text"
                                }
                           ],
                           "type": "paragraph"
                      }
                  ],
                 "type": "doc",
                 "version": 1
           }

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events