I want to transition an issue to a particular status. This execution is condition based. When an issue of a particular issue type is created, it is in "Open State". I want that if an issue of this particular issue type is created and condition is satisfied, the issue must be transitioned from "Open" to "In Analysis" state. I tried to do it via Script Post function and Script Listener using below code, but it did not work.
def actionId = 281
TransitionOptions skipConditions = new Builder().skipPermissions().skipValidators().skipConditions().build();
transitionValidationResult = issueService.validateTransition(technicalUser, issue.id, actionId,new IssueInputParametersImpl(),skipConditions)
if (transitionValidationResult.isValid()) {
transitionResult = issueService.transition(technicalUser, transitionValidationResult)
}
Any help would be appreciated.
No, you can't execute another transition while there is one in progress. Not with that approach anyway, your code needs to be a lot more clever than that, otherwise you end up in a situation where an issue has two status and no way of knowing which one it should be landing in.
Scriptrunner has a function that handles it right though. Have a look at "fast track transitions" under https://scriptrunner.adaptavist.com/latest/jira/builtin-scripts.html
Hello Nic Brough,
Thank you for the response.
I am aware that the "Fast-track transition feature" can be used but I cannot use it for this requirement because, the transition has to be performed by a different user and not the current user and we do not have a provision to set user here.
Hence, could you kindly let me know how to achieve this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could try it as a listener - catch the create event, interrogate the data in the event and trigger a second transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.