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:
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!
Hi Iain - have you also posted this over in the Developers Community?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you will get better answers over there. But leave this one here in case @Darryl Lee wants to chime in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.