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

This widget could not be displayed.

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 Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

536 views 23 15
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