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 Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

27,089 views 2 7
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