Skip to main content
Solved

Getting the selected decision answer of a decision task using assystREST


SGrant89
Hero (Employee)
Forum|alt.badge.img+6

Is there any possibility to get the selected Decision Answer of a Decision Task using assystREST? From playing around with the API, I can get the Attached Decision Answers on the Decision Task event, but I can't find any easy way to see which one was selected. I also had a look at the Actions schema which includes a Decision field, but it seems like this is only used when taking a Decision action via REST, and doesn't return a value after the fact.

Best answer by Julian Reid

You should be able to reach the selected answer for a task event via the following path: event -> parentStage -> tasks -> answer

For example: {server url}/assystREST/v2/events/{task event id}?fields=parentStage.tasks.answer

(There will only ever be one task in the “tasks” array of the “parentStage” since it is a decision stage.)

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img
  • Do Gooder (Employee)
  • 1 reply
  • Answer
  • July 12, 2022

You should be able to reach the selected answer for a task event via the following path: event -> parentStage -> tasks -> answer

For example: {server url}/assystREST/v2/events/{task event id}?fields=parentStage.tasks.answer

(There will only ever be one task in the “tasks” array of the “parentStage” since it is a decision stage.)


SGrant89
Hero (Employee)
Forum|alt.badge.img+6
  • Author
  • Hero (Employee)
  • 22 replies
  • July 12, 2022
Julian Reid wrote:

You should be able to reach the selected answer for a task event via the following path: event -> parentStage -> tasks -> answer

For example: {server url}/assystREST/v2/events/{task event id}?fields=parentStage.tasks.answer

(There will only ever be one task in the “tasks” array of the “parentStage” since it is a decision stage.)

Thanks Julian, that works perfectly. Got the selected answer and some of the details of the user who answered by using the following field pre-population and filtering: {server url}/assystREST/v2/events/{task event id}?[parentStage[tasks[answer[answer], answeredBy[servDept[shortCode]]]]]


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings