Call Second Transition from First Transition that goes both to same status

Rituraj Nepal February 22, 2024

I want to have two transition that would go to same status ( mytargetstatus)

One Transition (t1) would always be hidden from Users to Select from using Conditions that always sets its value to False. This hidden transition uses a Screen which have CustomField called mycustomfield.


Now I want users to be able to go to the another transition (t2), that would call first transition if customfield has some value thereby, displaying the screen associated with the hidden transition (t1)


If custom field do not have value, automatically shift to the status ( mytargetstatus)
Preferably I want to use post-action script in transition(t1) if possible.

Found Solution that would automatically transition to status (mytargetstatus), But I require to display the screen associated.

1 answer

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 22, 2024

Hi Rituraj - Welcome to the Atlassian Community!

Let's clear up one thing first. Transitions do not call transitions. Issues move from one status to another status using a transition. So you could say one status calls another one if you want, but that's not a good way of saying. 

So you simply have two transitions from Status A to Status B (mytargetstatus). One transition would have a condition where mycustomfield has a value of X. And the other transition would have a condition where mycustomfield != X. 

Automations that auto transition will not/can not call the transition screen in the process. You must do a manual transition not using a rule to see the screen popup. 

Rituraj Nepal February 22, 2024

My idea is to use transitionA ( Name of a Transition ) from all status to targetstatus.use transitionB ( Name of a Transition ) from targetstatus to targetstatus ( hidden always )
However, while transiting from all status to targetstatus using transitionA ( GUI),  I want to direct to targetstatus but using the postscript functions and screen associated with transitionB if a customfield have certain value. Does it sound any familiar solution to you ?

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 22, 2024

You can't have one transition use values or post functions in another transition - each transition is independent. Did you try to implement what I suggested? What will not work for that? 

Rituraj Nepal February 22, 2024

I had to came to this point because, using binary exclusive conditions for two different transition that points from same sourceStatus to targetStatus is not a solution to me. I would have similar transition name and condition would have showed right transitionOption to select from in the GUI. One with Screen and Other without Screen.

However, my context is that I would have to check condition during transitioning to targetStatus from any Status. Thus I came up an idea if it would be possible to create two transitions , transitionA and transitionB. One that could transit from all Status and another that transitions from targetStatus to targetStatus [targetStatus to targetStatus] would have screen. 

So while transitioning from any Status to targetStatus, I was thinking of possibility to 

#1. Fetch a Value 

#2. Validates Condition

#3. If Condition matches : Pop up Screen used by hidden transition

   Else : Directly set targetStatus ! 

Rituraj Nepal February 22, 2024

Using a Validator is also not an option because , Validator would restrict the transition to target status. I only want to show the screen before transitioning to the target status for a condition I want. I want to just make sure the screen pops up, user sees the value and if the user wants transit to new status and if not, the user can simply cancel the transition. 

 

Using Following Code : transitioning to targetStatus was possible. But I do not want automatic transition.

transitionID = 11 

 

WorkflowTransitionUtil workflowTransitionUtil = (WorkflowTransitionUtilJiraUtils.loadComponent(WorkflowTransitionUtilImpl.class);
   
workflowTransitionUtil.setIssue(issue);
workflowTransitionUtil.setAction(transitionID);
workflowTransitionUtil.validate();
   
ErrorCollection errors = workflowTransitionUtil.validate();
if (!errors.hasAnyErrors()){
        workflowTransitionUtil.progress();
}
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 22, 2024

I never mentioned a validator - only conditions. Have you tried what I suggested? And if not, why not? 

Rituraj Nepal February 22, 2024

Using Only Conditions surely works if requirement would have been different.

My Requirements :

#Transit to TargetStatus from any Status [Global Transition]

#Show Screen Only for a Condition [This Condition would be tested during the process of transitioning because value needs to be fetched specifically during transition]

For two transitions pointing from sourceStatus to targetStatus using conditions would have worked. However, I have a requirement to transition from any status and Jira restricts to create two global transition that goes to a targetStatus.

 

If there was a possiblity to create two global transition, using conditions would have solved the problem. I would only have required to name the global transition ( similar) , one which would use screen and the other without screen. 

 

Are we closer to the solution ? 

 

 

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 22, 2024

No, you can't have two global (All) transitions to a single status. And you can't do what you want where it generates a new transition on demand based on the value of a field. 

You can use one All (global) transition, and then you would have to create separate transitions from all of the other statuses. Or you could have an interim status that uses the same Transition name but is based on the field. Then if an issue goes to that status, you could have an automation rule that auto transitions it the targetStatus. Only condition on that would be for the group = the atlassian-addons group. 

Suggest an answer

Log in or Sign up to answer