Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,294,687
Community Members
 
Community Events
165
Community Groups

How to create a simple POST custom REST for setting issue status

Dear all,

I have browse documentation on how to create sample custom REST api in script runner but some point are unclear to be

I need to create a simple POST request endpoint which will simply set the status of any issue of what is pass from the body param of the request.

When the external application is calling the POST endpoint SetIssueStatus, then the body parameter should be status =""

From that body status I should be then able to set the issue status

I have no idea and could not find sample on how to do this except basic one I have check already

my starting method is as below :

setIssueStatus(
httpMethod: "POST"
) { MultivaluedMap queryParams, String body ->

 ===> what to add here to read the status param from received body and then update issue status ??

}

for exemple is recevied status body param = "Completed" then I should set issue status to Completed as well

Thanks for help

regards

1 answer

1 accepted

0 votes
Answer accepted

You can not just "set the status" of an issue.  Your code will need to push the issue through a transition to take it from the current status into a new one.

https://library.adaptavist.com/entity/transition-an-issue-using-issue-input-parameters is an example of a script that transitions an issue.

Thans for your reply @Nic Brough _Adaptavist_ I know how to transition an issue through script runner.

What I need to do is how to validate the body which is pass to my script runner endpoint and read the received status

Any idea

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

274 views 0 6
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you