Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can i change the status by using name?

AKASHB
Contributor
July 31, 2013
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
Nic Brough -Adaptavist-
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.
July 31, 2013

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.

AKASHB
Contributor
July 31, 2013

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

Nic Brough -Adaptavist-
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.
July 31, 2013

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)

AKASHB
Contributor
July 31, 2013

Thanks a lot Nic for your feedback.

AKASHB
Contributor
August 1, 2013

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

AKASHB
Contributor
August 1, 2013

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

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events