Forums

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

Updating custom form values in JSM via REST

Iain McCarthy
Contributor
July 8, 2025

 

Hi all. I am looking for some working examples of custom form field updates via REST.

 

I can't use custom Jira fields to map, as my forms use data connections, so must go direct through the forms API.

 

The Atlassian Doc falls JUST short of being useful, here:

https://developer.atlassian.com/cloud/forms/rest/api-group-forms-on-issue/\#api-issue-issueidorkey-form-formid-put

This provides the endpoint and request structure but no examples of the field data itself, which is the operative bit. 

--data '{
"answers": {}
}'

This document appears to show the valid structure, but I can't get it to work. If I send this as a payload (the long string is the field's dcId, I've also tried the numeric field number),

{
"answers": {
"68f27692-5a3c-4943-b7d4-b11d80e3f44b": { "choices": ["3441468"] }
}
}

I get the following response: 

 "errors":[{"status":400,"code":"BAD_REQUEST","title":"There was an issue with your request","detail":"1 error found in JSON: (1) should be a JSON object"}]}

Any example of drop-down, text and numeric field updates that you have working on your instances would be super helpful, thank you!

2 answers

1 accepted

6 votes
Answer accepted
John Funk
Community Champion
July 8, 2025

Hi Iain - have you also posted this over in the Developers Community?

https://community.developer.atlassian.com/

Iain McCarthy
Contributor
July 8, 2025

I have not! Was not aware that was a distinct thing, thank you - if this question seems more appropriate for that spot I will ask over there. 

Like John Funk likes this
John Funk
Community Champion
July 8, 2025

I think you will get better answers over there. But leave this one here in case @Darryl Lee wants to chime in. 

4 votes
Darryl Lee
Community Champion
July 8, 2025

Hi @Iain McCarthy - the page you shared (Integrating Custom Form Fields into Jira Ticket Creation API) says:

(Experimental) Provides answers to the form associated with a request type that is attached to the request on creation

(Emphasis mine.)

So I believe that  this is only for populating a form when you are creating a NEW issue. 

You said you're looking to update fields on a form. I take that to mean you're wanting to change values on forms that have already been submitted.

My reading of Forms API is that to update an existing form you would need to:

  • Get the IDs of all forms attached to an ticket: Get form index 
  • Get existing answers for your form (assuming it's just one), using the formId from the step above. I think when you save answers you have to save all of them. So you'll want to get all the values that you'll need to retain or update: Get form simplified answers 
  • You might need to reopen the form: Reopen form 
  • Save the answers: Save form answers
  • Submit the form: Submit form 

I (finally) found some pages with some examples (using web requests in Automation) that might help:

I don't have time right now to test this myself, but those last two articles from @Bruno Altenhofen have a good amount of data. Maybe he can weigh in and see if my suggestions are correct.

Iain McCarthy
Contributor
July 9, 2025

Thanks Darryl, this is very helpful. If it is easier programatically, I have the option to add the form when I'm writing these answers, it doesn't need to pre-exist on the issue (the form addition step was done immediately prior with Jira Automation, but can be synchronous instead).

I'll have a read through the links you've provided, but if adding and submitting a form *with answers* is an easier process than an edit, this will work too. 

Like # people like this
Darryl Lee
Community Champion
July 9, 2025

AH yes, if it's not an Update but rather adding a new form, that's (probably) much easier:

What's weird about these APIs is that there's separate ones for Customer Requests, which seem redundant with the Issue ones, except there's no "Add form" for Requests. Curious.

Anyways though, if you're doing this programmatically, using the Issue APIs should be fine, since your script or whatever should have full permissions (as opposed to perhaps more limited Customer Request access).

BTW, if the form needs to be visible to Customers, you'll also need to: 

(I think by default adding a form from the Issue side sets visibility to Internal.)

Like John Funk likes this
Iain McCarthy
Contributor
July 9, 2025

Thanks Darryl, will try this - my only concern with doing this in one step is that dynamic data connections may not have populated fields with values needing to be set at time of creation. Will report back... 

Like John Funk likes this
Iain McCarthy
Contributor
July 9, 2025

No joy unfortunately. 

  • Get Form UUID - pass
  • Reopen Form - pass
  • Get simplified answers - pass
  • Save form answers (same as the simplified answer set) - fail

{"errors":[{"status":400,"code":"BAD_REQUEST","title":"There was an issue with your request","detail":"1 error found in JSON: (1) should be a JSON object"}]}

As for the field keys in "answers", I have tried the field keys presented in the simplified answers set (as below), the numeric field identifier, and the full dcId. 

The error message may be somewhat generic but I'd hope if there was a field ID mismatch it would say something else. As is, it says the JSON below is malformed. This is full answer set returned with the get answers method.  

 

{
  "answers":{
    "line-1-quantity":"0",
    "line-1-value":"0",
    "summary-memo":"test description",
    "quote-1":"",
    "requisition":{"choices":["0000000"]},
    "vendor":"",
    "currency":{"choices":["1"]},
    "line-1-type":"",
    "line-1-department":"",
    "line-1-description":"",
    "more-lines":{"choices":["2"]}
  }
}

 

Like John Funk likes this
Darryl Lee
Community Champion
July 9, 2025

Hey @Iain McCarthy - 

tl;dr - I found a totally different API endpoint with a different payload when I updated a JSM form on my instance. For your endpoint, try omitting quotes around number field values:

"line-1-quantity" : 0,
"line-1-value" : 0,


WARNING LONG POST AHEAD!

Ok so I went to one of my test forms in a Service Project and updated data, and looking at the good old Network tab of the Developer Panel, here's the endpoint that was hit when I Saved changes:

What's weird is that that does not match what's in the docs:

https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/form/{formId}

Oh man, proforma. That's confusing.

For context, in 2021 Atlassian acquired ThinkTilt, makers of ProForma. For many years, ProForma was one of the top add-ons for adding forms to Jira (both Service Management and Software). ProForma forms allowed for conditional logic - allowing you to show/hide fields based on the values of other fields. Very useful and powerful!

Unfortunately after purchasing ProForma, Atlassian only saw fit to add it to JSM.

In October 2025, they introduced a "Simplified" Forms for Jira Software which uses the same code as forms for Jira Work Management/Business Projects. It doesn't have the conditional logic of ProForma (JSM) forms, but has some interesting differences:

  • a forms access can be set to "open" meaning a user does not need project create permissions to submit a form (as long as they have access to the instance)
  • field can be set as required on the form only (and not for the issue create screen or other inline create channels)
  • a field description can be added to the form (and not reflected on the issue create screen)

In this article @Bruno Altenhofen references the proforma API:

But what's weird is that the Forms API we've been looking at mention Requests, and those that's definitely a JSM thing, and to confirm, your forms are in JSM, not Jira Software, correct?

Here's the other weird thing. In the payload I saw submitted below, you'll note the lack of field names. It looks very different from the examples you've found, and also there's no "answers" to be seen anywhere!

I wonder if the Web UI is using the old APIs, and the new APIs are just that, new.

One thing I would suggest (even though the payload below doesn't show it), is if "line-1-quantity" and "line-1-value" are actually number fields, then omit the quotes, and just do:

"line-1-quantity" : 0,
"line-1-value" : 0,

Oooof, this post is way too long. Let me put a tl;dr at the top.

Payload:

{
  "1": {
    "text": "Darryl Lee"
  },
  "2": {
    "text": "408-555-1212"
  },
  "3": {
    "text": "Department of Funny Walks"
  },
  "4": {
    "text": "Funny Walker"
  },
  "5": {
    "text": "darryl@funnywalks.com"
  },
  "6": {
    "text": "12345"
  },
  "7": {
    "date": "2025-07-14"
  },
  "8": {
    "text": "San Jose"
  },
  "9": {
    "text": "100"
  },
  "10": {
    "date": "2025-07-18"
  },
  "11": {
    "text": "Awesome Walks"
  },
  "12": {
    "text": "5"
  },
  "13": {
    "text": "Roku, Atlassian, Spirit Air"
  },
  "14": {
    "text": "Kirkland, Chewy, Brother"
  },
  "15": {
    "text": "",
    "choices": [
      "1"
    ]
  }
}

 

What my form looks like:Screenshot 2025-07-09 at 10.23.40 PM.png

 

Like John Funk likes this
Darryl Lee
Community Champion
July 10, 2025

Actually, looking at the Integrating Custom Form Fields into Jira Ticket Creation API  example, it does look similar to the data submitted to the proforma API. I think what you need to do is get your Field IDs, as they mention. You're supposed to be able to  get this by hitting this endpoint:

https://api.atlassian.com/jira/forms/cloud/CLOUDID/servicedesk/SERVICEDESKID/requesttype/REQUESTID/form

CLOUDID: https://YOURSITE.atlassian.net/_edge/tenant_info

To find the SERVICEDESKID and REQUESTID: How to find serviceDeskId and requestTypeId 

Weirdly, I could not get that endpoint to work for me!

But here's a hack to get the Field IDs. If you use Developer Panel and inspect elements, the field ID is in the label for each field:


formfieldids.jpg

Or you could do what I did and sniff the network traffic when you update a form.

At any rate, I believe your payload should look something like this.

{
  "1": {
    "text": "0"
  },
  "2": {
    "text": "0"
  },
  "3": {
    "text": "test description"
  },
  "4": {
    "text": ""
  },
  "5": {
    {"choices":["0000000"]},
  },
  "6": {
    "text": ""
  },
  "7": {
    {"choices":["1"]},
  },
  "8": {
    "text": ""
  },
  "9": {
    "text": ""
  },
  "10": {
    "text": ""
  },
  "11": {
    {"choices":["2"]}
  }

 The trick is getting the right IDs. For me, it mapped like so:

Screenshot 2025-07-09 at 10.23.40 PM.png

Ugh, I wonder why that API endpoint above doesn't work.

Like # people like this
Darryl Lee
Community Champion
July 10, 2025

OMG. The API documentation for Get form on a request type is a little misleading. They say you need requestTypeId. Gaaaah. It should be requestFormId.

It should be:

https://api.atlassian.com/jira/forms/cloud/CLOUDID/servicedesk/SERVICEDESKID/requesttype/REQUESTFORMID/form

Where REQUESTFORMID is found when you edit your form: 

https://YOURSITE.atlassian.net/jira/servicedesk/projects/HELP/settings/request-types/category/service-request/request-type/1/request-form

UGH. ANYWAYS, if you load up that API endpoint, you get a lovely JSON file with all the questions. Here's an excerpt:

    "questions": {
      "12": {
        "label": "Number of sessions you will attend",
        "type": "no",
        "validation": {}
      },
      "8": {
        "label": "Location",
        "type": "ts",
        "validation": {}
      },
      "4": {
        "label": "Job title",
        "type": "ts",
        "validation": {}
      },
      "13": {
        "label": "Speakers from leading companies like:",
        "type": "pg",
        "validation": {}
      },
...

Whew. Ok, that's probably enough for tonight. LMK if you have any questions. :-}

Like # people like this
Iain McCarthy
Contributor
July 10, 2025

Same error with your suggested payload, unfortunately. Can I confirm this works for you? 

To an earlier question: yes, this is JSM and these are requests. They don't need external vis (internal workflow only). 

Appreciate your time on this!

[for ref, latest payload I've tried - both with and without the "answers":{} wrapper]

{
"285": {
"text":"0"
},
"284": {
"text":"0"
},
"185": {
"text":"test description"
},
"314": {
"text":""
},
"199": {
"choices":["0000000"]
},
"171": {
"text":""
},
"152": {
"choices":["1"]
},
"200": {
"text":""
},
"207": {
"text":""
},
"286": {
"text":""
},
"208":{
"choices":["2"]
}
}

 

Like John Funk likes this
Darryl Lee
Community Champion
July 10, 2025

Hey @Iain McCarthy can you share the output of Get simplified answers ? I could not get this to work with my forms last night. I also couldn't get Form index working. Odd!

Iain McCarthy
Contributor
July 10, 2025

Yep! Simplified answers output below. The numeric IDs above are from the full form method, and represent the field keys below.  

[
{
"label": "Quantity",
"fieldKey": "line-1-quantity",
"answer": "0"
},
 {
"label": "Unit Cost (pre-GST)",
"fieldKey": "line-1-value",
"answer": "0"
},
{
"label": "Description",
"fieldKey": "summary-memo",
"answer": "test description"
},
{
"label": "Quote / Invoice # (if applicable)",
"fieldKey": "quote-1",
"answer": ""
},
{
"label": "Requisition",
"fieldKey": "requisition",
"answer": "Unplanned",
"choice": "0000000"
},
{
"label": "Vendor",
"fieldKey": "vendor",
"answer": ""
},
{
"label": "Currency",
"fieldKey": "currency",
"answer": "CAD",
"choice": "1"
},
{
"label": "Expense Type",
"fieldKey": "line-1-type",
"answer": ""
},
{
"label": "Department",
"fieldKey": "line-1-department",
"answer": ""
},
{
"label": "Line Detail",
"fieldKey": "line-1-description",
"answer": ""
},
{
"label": "",
"fieldKey": "more-lines",
"answer": "No",
"choice": "2"
}
]
Darryl Lee
Community Champion
July 10, 2025

Hi @Iain McCarthy welp, my problems with Form index was me being dumb and forgetting --header 'Accept: application/json'

Anyways, yeah, I tested a PUT and it worked. Here's the curl command I used:

% curl -n 'https://api.atlassian.com/jira/forms/cloud/CLOUDID/issue/HELP-57/form/2a4b4cd9-c316-4c1a-b69b-36f69cbcf724' \
--request PUT \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '@formdata.json

And here is my data file (formdata.json):

{
    "answers": {
        "1": {
            "text": "Test Lee"
        },
        "2": {
            "text": "408-555-1212"
        },
        "3": {
            "text": "Let's update this form"
        },
        "4": {
            "text": "With new data"
        },
        "5": {
            "text": "darryl@funnywalks.com"
        },
        "6": {
            "text": "12345"
        },
        "7": {
            "date": "2025-07-14"
        },
        "8": {
            "text": "San Jose"
        },
        "9": {
            "text": "100"
        },
        "10": {
            "date": "2025-07-18"
        },
        "11": {
            "text": "Awesome Walks"
        },
        "12": {
            "text": "5"
        },
        "13": {
            "text": "Roku, Atlassian, Spirit Air"
        },
        "14": {
            "text": "Kirkland, Chewy, Brother"
        },
        "15": {
            "text": "",
            "choices": [
                "1"
            ]
        }
    }
}

If you are still getting errors about malformed JSON, I suggest running your data through https://jsonlint.com/ - it helped me find an extra " character that had snuck in.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events