You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
Within a postfunction, I need to get both before and after status objects.
When I call issue.getStatusObject(), it gives me the current status object. However I also need the upcoming status object.
Is there a way to get this next status object?
Thanks in advance
Tuncay
Community moderators have prevented the ability to post new answers.
Hi,
This is the exact code getting before and after steps
List<SimpleStep> currentSteps = (ArrayList<SimpleStep>)transientVars.get("currentSteps"); SimpleStep simpleStep = currentSteps.get(0); int actionId = simpleStep.getActionId(); int beforeStepId = simpleStep.getStepId(); ActionDescriptor ad = workflow.getDescriptor().getAction(actionId); int afterStep = ad.getUnconditionalResult().getStep();
I think you may just need to move your script down the order, so it fires after the transition has happened. Check the list of Post Functions for the transition in the workflow editor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
is this what you are looking?
def stepId = action.getUnconditionalResult()?.step getWorkflowDescriptor().getStep(stepId)
check this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can get availble actions like this
IssueWorkflowManager issueWorkflowManager = ComponentAccessor .getComponentOfType(IssueWorkflowManager.class); Collection<ActionDescriptor> actions = issueWorkflowManager .getAvailableActions(issue);
if my guess is correct, you are trying to auto transition issue to next state, if it is correct then i don't think it will work by using post function yu have to do it by using listener.
loads of discussions had in this forum just search like auto transition you will find lot of posts
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rambanam,
Thanks for your answer. However I am not looking for auto transition.
All I need is just the state info.
For example, in "Start Progress" transition, the issue's status changes from "Open" to "In progress". In the post function, I need "In Progress" status object in order to calculate something.
Thanks again
Tuncay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.