Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy-Postfunction: How to detect, wether current transition clears resolution?

Axel Joester
Contributor
November 2, 2022

In a workflow, we use a transition to open-status. The user can take this transition from any other status (a shared transition).

On the transition we have a scriptrunner/groovy-post-function that should set some progress-customfield to it's previous value, if, and only if, the current instance of the transition leaves from a resolved status.

I figured out how to find the previous value via ChangeHistoryManager. Simple.

But: How can the post-function detect, that the current instance of the transition leaves from a resolved status?

 

Background: Of course, we could just define two transitions: One from all resolved states, another one from all unresolved states. In reality, we have multiple states and multiple shared transitions and don't want to define all of them twice. 

 

 

1 answer

1 accepted

0 votes
Answer accepted
Axel Joester
Contributor
November 2, 2022

Ah, nevermind, I found a simple solution in my case:

The transitions to done-statuses sets the progress custom field to 100%.

When transitioning to a not-done status, I set the progress field back to its previous value.

But now I only do that, if it currently is at 100%.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events