What Issue Status should I see in a Post Function Script?

Jeff Abbott December 11, 2020

I assumed I would see the status Post the transition, but I am seeing the status prior to the transition.  Is this expected behavior?

2 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 11, 2020

In a post-function, you will see the current status of the issue - the issue object has been read at the start of the transition and the status won't change until the end of the transition where the issue gets stored in the database with its new values.

So yes, that's exactly what I'd expect to happen.

Jeff Abbott December 11, 2020

Thanks Nic, looks like a need a listener instead of  a post function.

0 votes
Jeff Abbott December 17, 2020

I did some more reading. Atlassian makes this statement:

Post functions carry out any additional processing required after a Jira workflow transition is executed, such as:

  • updating an issue's fields
  • adding a comment to an issue

Here: https://developer.atlassian.com/cloud/jira/software/modules/workflow-post-function/ 

I am back to figuring out why I don't see the status updates in my post function.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 17, 2020

Because the status has not changed yet.  It only changes after the transition.  It's not a field, it is a display of where the issue is in the workflow, and during a transition, that is "in the starting status".

Like Jeff Abbott likes this
Jeff Abbott December 25, 2020

Thanks Nic, I now understand how to approach these scripts.  I was trying to write one script for all transitions for a given issue type, rather than one script per transition across issue types.

Jeff

Suggest an answer

Log in or Sign up to answer