Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Workflow transitioned not being saved

MonishP
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.
September 3, 2012

I perform the following code, it indicates that the transition is successfully completed but it is not reflected. I have tried reindexing but noting, I am quite sure that I am missing something very simple, could any one please help me? Thanks

ActionDescriptor thisStep; //supplied
      IssueService issueService = ComponentManager.getInstance().getIssueService();
      IssueInputParameters issueInputParameters = new IssueInputParametersImpl();
      IssueService.IssueResult transResult;  
      issueInputParameters.setStatusId(status.getId());
      
      //validate transition
      TransitionValidationResult validationResult = issueService.validateTransition(user, issue.getId(), thisAction.getId(), issueInputParameters);
      
      //check if the transition is valid
      if (validationResult.isValid()) {
         log.debug("Valid transition");
         
         //actually, transitioning
         transResult = issueService.transition(user, validationResult);
         
         if(transResult.isValid()){
            log.debug("Transition successful");
            
            issue = ComponentAccessor.getIssueManager().getIssueObject(issue.getKey());
            
            log.debug(issue.getKey()+" is "+ issue.getStatusObject().getName());
            
         } else {
            log.debug("Invalid transition: "+transResult.getErrorCollection().getErrorMessages());
         }
         
      } else {
         log.debug("Invalid transition: "+validationResult.getErrorCollection().getErrorMessages());
      }

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Jobin Kuruvilla [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.
September 3, 2012

You don't need to set Status in IssueInputParameters. Only fields like resolution, if needed, are set there. And how are you getting thisAction? Are you sure the action id is correct?

MonishP
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.
September 4, 2012

Yep, I had the action id's wrong. Thanks

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 3, 2012

Can you check the indexing on an issue that has had this done? Look at the issue on it's own in the issue view - check the status there. Then do a search that includes it (any will do - simple, jql, etc, even if it only returns that one issue) and check the status column on the issue navigator.

Do the two reported status match, or is one the previous value?

MonishP
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.
September 4, 2012

Thanks for your help, but I figured out my problem.

TAGS
AUG Leaders

Atlassian Community Events