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".
"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.
"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.
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"
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.