Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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

serge calderara
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.
Aug 02, 2021

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

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
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.
Aug 02, 2021

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.

serge calderara
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.
Aug 02, 2021

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

TAGS
AUG Leaders

Atlassian Community Events