Solved

Getting the selected decision answer of a decision task using assystREST

  • 11 July 2022
  • 2 replies
  • 229 views

Userlevel 3
Badge +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.

icon

Best answer by Julian Reid 12 July 2022, 11:58

View original

2 replies

Userlevel 1
Badge

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.)

Userlevel 3
Badge +6

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