How can i change the status by using name?

I have a code through which i am making Auto Transition by using ID but since its not the right way to do it, since ID may change. So i want ot perform Tranistion based on name so anyone out there can help me out. My piece of code is like. /* WorkflowTransitionUtil workflowTransitionUtil = ( WorkflowTransitionUtil ) JiraUtils.loadComponent( WorkflowTransitionUtilImpl.class ); //This will capture the Wokflow workflowTransitionUtil.setIssue(issue); //This will set the Issue workflowTransitionUtil.setAction(221);//This will set the Action Id workflowTransitionUtil.progress(); //This will vallidate the progress */ So here i need to do by name.

1 answer

0 votes

The name of a transition is even more likely to change than the ID. I'm not sure there's any mileage in using the name over the ID. Also, Atlassian have issues logged to enable translations of names, so a single transition, with one ID could end up with several different names. I know the API lets you get a name for an ID, but I don't think it's got anything for doing the reverse. I'm afraid your code might have to read the entire workflow for each transition and pull out a name, and hope it matches.

So Nic, but its possible to make transitions right. But its just that it may end up messing.

Yes, I think it's possible, but I can't see an API method to do it - you'll have to loop through all the transitions in the workflow until you find one with a matching name.

(And deal with "no transition found because the name has changed" - I'd just fail gracefully and silently, but it does mean you'll need to explain this to users)

Thanks a lot Nic for your feedback.

I too have tried but, there aren't any API defined to update an issue by Name.

Any more comments on this issue from all the experts will be helpfull

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,897 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot