Missed Team ’24? Catch up on announcements here.

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

Could we please have ID be included in the "simplified answers" API response?

Iain McCarthy July 10, 2023

Our list IDs on form drop-downs are meaningful (more meaningful than the label, which is returned via the simplified answers method). 

If you could include the ID in the simplified answer response it would save us a huge amount of time in post-processing (it's so hard to match these values through the full form JSON as the question and answer arrays are separate). 

Some pictures attached to illustrate what I'm talking about! Thank you!

 

list_id.pngfull_form.png

Screenshot 2023-07-10 at 11.00.08 PM.png

3 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
2 votes
Answer accepted
Iris Zhang
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2023

Choice ID has been added, see FormSimplifiedAnswer.choice field in Get form simplified answers Response.

Iain McCarthy July 26, 2023

Tested and confirmed! Wonderful, thanks @Iris Zhang  - this is going to save us so much time and make forms far more useful. Much appreciated!

Kind regards, Iain

Like # people like this
Robby Ibrahim July 26, 2023

I think I'm getting excited about this but we've never used the Forms api.

We rely heavily on forms and have dove into Entity Properties to extract data out of our forms answers in lieu of JQL search. It's dicey at best. How can we use the Forms api to solve some of the issues we face when mining entity properties? I also see you're looking up form answers in a data connection? My mind broke. Would love to hear some of your use cases! 

Rudy Holtkamp August 7, 2023

@Iris Zhang would it also be possible to add the question id?

We have forms that have several levels of conditions and sometimes the same question (label) appears (but with different answer options). It would be nice to be able to distinguish these questions. 

Iris Zhang
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 7, 2023

@Rudy Holtkamp 

Thank you for bringing this to our attention. We have reviewed your request and attempted to include the question ID as well. However, we have confirmed that the question ID has been intentionally excluded from the "Get Simplified Answers" endpoint due to its instability and potential for unexpected changes upon editing the form. This could cause issues with your script or application.

We recommend using a specific `Field Key` for form fields that need to be distinguished, as this is more reliable and already included in the "Get Simplified Answers" endpoint.

If you don't require a flattened response, you can use a combination of the "Get Form" endpoint (available for both "Forms on Customer Request" and "Forms on Issue") and the "Get External Form Data" endpoint (currently only available for "Forms on Customer Request"; the equivalent for "Forms on Issue" is in development).

Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 8, 2023

Thanks, @Iris Zhang , I will use the fieldkey.

Like Iris Zhang likes this
1 vote
Iris Zhang
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 11, 2023

In the context of multiple selection questions, the simplified answers API has been utilizing a format such as {"answers": "value1, value2"}. Following this approach, would the format below be suitable for your tools to process?

[
{
"label": "Involved Departments",
"id": "4, 5, 6",
"answer": "HR, Finance, Sales"
},
{
"label": "fav food",
"answer": "pie"
},
{
"label": "Owner Department",
"id": "2"
"answer": "Corporate"
}
]

 

Tyler Wang
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 11, 2023

Alternatively, there could be a choices field like so:

"choices": [
{
"id": 1,
"label": "Information Services"
},
{
"id": 2,
"label": "HR"
},
{
"id": 3,
"label": "Finance"
}]
and answers will still contain the original string of labels
"answers":  "Information Services, HR, Finance"
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 11, 2023

I've forms for receipt declarations where there are multiple sections so you can add different receipts. But the questions and thus the labels are the same. Is it possible to ad the question id also to this json response?

Tyler Wang
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 12, 2023

Yes, question ids can be added 

Iain McCarthy July 13, 2023

Thanks - @Iris Zhang's initial proposal would certainly work for us, if the ids follow the same logical pattern as the answer field it's easy and logical to parse. 

Adding a separate choices array would also work (I presume @Tyler Wang this was intended to show only selected choices, and not all available choices) 

I appreciate the response, this would be a huge improvement in the utility of this API service for us. 

0 votes
Rudy Holtkamp July 11, 2023

Hi @Iain McCarthy ,

I strongly agree that the JSON of the form is a nightmare and I don't understand why it should be this difficult. Questions and answers are stored in two different places. When you have the answer to a single/multiselect question you only get the id. Which you need to lookup at the question section. It is a horrible when you need to create a simple table in e.g. Confluence from your form with Automation for JIra.

I've written an Python script just to get the answers.

TAGS
AUG Leaders

Atlassian Community Events