Forums

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

How to create a button on an issue which will execute an API call

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.
April 7, 2021

Dear all,

We have a use case customer request which is as below :

  • From a jira issue, we need to create a button name "Send Change"
  • Once this button is pressed, a script gets executed and will call an API in servicenow in order to create a change request.

 

Question :
What is the way to create that custom button on the issue screen and when pressed runs a script runner script ?

Note that this button need to be all time active, meaning that If I click 2 times on it, it will call 2 times the script

Thanks for solution to create that button

regards

 

 

1 answer

0 votes
Nic Brough -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.
April 7, 2021

Most Atlassian server stuff implements most of the UI using "web fragments" which can be panels, menus, items or even css/js resources (and other stuff).   Scriptrunner can make use of those and inject its own.

In this case you'll want https://docs.adaptavist.com/sr4js/latest/features/script-fragments/custom-fragments/web-item but you'll want to read the page above it too for finding out how to set up your web-item to appear where you want!

Suggest an answer

Log in or Sign up to answer