I have a transition with 8 post functions. Here is the sequence of the post functions:
1. Update Any Issue Field (JSU) - updates customfield_A value to %%CURRENT_USER%%
2. Update Any Issue Field (JSU) - updates customfield_B value to %%CURRENT_DATETIME%%
3-7. All the five essential post functions
8. Custom script post function (Adaptavist) - gets the issue key then runs a script in the local Jira server which includes using the key to curl for the current issue JSON
Now the problem is, post function no. 8 acquires the issue JSON of the previous issue state (not status), meaning customfield_A and customfield_B still have null values. I tried putting sleep before the curl command to check whether Jira needs time to update the issue (while also increasing the waitFororKill of the groovy script) to no avail.
I also tried this scenario to confirm that the previous state is what's being curled:
a. User1 performs the transition from statusX to statusY at time1 - customfield_A and customfield_B returns null
b. Looped back from statusY to statusX
c. User2 performs the transition from statusX to statusY at time2 - customfield_A has a value of User1 and customfield_B has a value of time1
My question is, is this a problem with my post function arrangement or is this an expected behavior?