How to do a force transition using groovy?

Kiran Jonnada June 25, 2018

Hi All,

I already have the code which transitions an issue from one status to another status if there is transition between these two statuses. But, I want to change status of the issue if though there is no transition between two statuses. 

 

Thanks,

Kiran.

2 answers

1 vote
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 25, 2018

The short answer is: you don't. Jira doesn't support modifying the Status field without using a transition.

What you can do is create "invisible" transitions between the two statuses (or between any status and the destination status - i.e. a "global" transition). You can hide transitions using the "Hide transition from user" Condition.

Kiran Jonnada June 26, 2018

Thanks David

Like Sami Touihri likes this
0 votes
Mark Markov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2018

Hello @Kiran Jonnada

Actually there are exists one method that can do it: workflowManager's migrateIssueToWorkflow method.

https://docs.atlassian.com/software/jira/docs/api/7.1.5/com/atlassian/jira/workflow/WorkflowManager.html#migrateIssueToWorkflow-com.atlassian.jira.issue.MutableIssue-com.atlassian.jira.workflow.JiraWorkflow-com.atlassian.jira.issue.status.Status-

But i'm not sure how it will be works when you migrate issue on the same workflow.

It needs some test in non-product environment :)

At least you can migrate issue on temp tech workflow and then migrate on target.

Kiran Jonnada June 26, 2018

Thanks Mark

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events