Is that Possible to make a REST Call from Jira

Kumar
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.
April 18, 2019

Hi Team,

I have a requirement. I have a Workflow in that I have a Transition called "Approve" 

so when ever the the Issue got approved need to make a REST 

I have

Header : Content-Type: application/json

URL: http://xyz.com/create_ec2_instance 

Request Body: {"Location":"aws","InstanceType":"t2.nano","Tag":"mytag","Owner":"xyz"}

 

here is the requirement

Now I need make a REST call based on the Value selected in the Custom Field Can we do that

Example:

1) I have a custom Fields called 
            a) Location : aws, cnet, azure ---> Select List field
            b) Instance Type: t2.nano, t2.micro, t2.small, t2.medium ----> Select List field
            c) Owner ---> Text Field
            d) Tag ----> Text field
            e) Cost Center ---> Text field
            f) Size of Memory ----> Text Field
            g) Size of Disk -----> Text Field

2) Now When the issue got created in the Project based the Value in the custom Field need make a REST call based on that

---> Now i'm creating a issue with Location= aws, Instance = t2.nano, Owner = xyz, Tag= my tag, Costcenter = 8500

----> Now When the Issue got Approved it has to Make a Rest Call and create a AWS instance in AWS based the Value i gave in the Custom Field

---> same like that if i create a ticket with different value Location= cNet, Size of Memory = 30, Size of Disk = 2024, Owner = xyz, Tag= my tag, Costcenter = 8500

----> Now it has to create a the Cnet instance based the Value i given the field when the ticket got approved

 

Is that Possible if it is Can you please suggest me how to do it with script runner or any

other way to do it 

 

Thanks,

Kumar

1 answer

0 votes
Ed Gaile _Atlanta_ GA_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 18, 2019

Hi Kumar -

Yes, you can make a REST call via scriptrunner.  Here is an example of that:

https://community.atlassian.com/t5/Adaptavist-questions/Making-a-REST-call-using-script-runner/qaq-p/576712

That should point you down the right path.

Cheers,

-Ed

Suggest an answer

Log in or Sign up to answer