Forums

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

Getting error when transitioning a subtask to Cancel via API

David Whitlock February 23, 2023

Hello,

I am trying to transition subtasks to the Cancel Sub-Task transition in the API using the endpoint rest/api/2/issue/GS-34233/transitions

the body I post is {"update": {"comment": [{"add": {"body": "Resolved via automated process."}}]},"transition": {"id": "51"},"fields": {"resolution": {"name": "Canceled"}}}

 

however when I execute the endpoint I get the following error:

400
{"errorMessages":["It seems that you have tried to perform a workflow operation (Cancel Sub-Task) that is not valid for the current state of this issue (GS-34233). The likely cause is that somebody has changed the issue recently, please look at the issue history for details."],"errors":{}}

I am confused by this error, If I manually transition this to Cancel, it seems to work fine. Any idea why I may be getting this error?

 

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
March 1, 2023

Hello @David Whitlock 

In the workflow for Subtasks, are there any Conditions or Validators specified for that transition?

David Whitlock March 10, 2023

Thanks for the reply. There is one validator but all it does is check to see if the task has subtasks and cancels those as well

Trudy Claspill
Community Champion
March 10, 2023

Can you provide a screen image of the workflow used for subtasks?

Can you provide a screen image of the Validator details for the specified transition?

Suggest an answer

Log in or Sign up to answer