How to update a custom field value periodically by making REST call?

ananya6 April 18, 2018

I have a custom field called event_count whose value I am geting from an external system called Qradar while ticket creation using post REST call. Now I want that custom field value to get updated after a certain period of time by making a get REST call to qradar. How to run groovy scripts as a jira service? This groovy script will not be invoked on a particular event but rather after a fixed interval of time.

1 answer

0 votes
Alexey Matveev
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, 2018

You would need the ScriptRunner plugin for it.

ananya6 April 18, 2018

ScriptRunner plugin as in I have to write a Behaviour script & register as it a service in jira. But my question is in which path I will save the groovy script?

Alexey Matveev
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, 2018

You can not execute behaviour as a script. Behaviour requires html browser to be run, but your script will work in the server. 

You usually save scripts in JIRA_HOME/scripts folder

ananya6 April 18, 2018

Thanks for the reply. And this script kept in this path can I  register as service in jira? As I am keeping a groovy script inside WEB-INF/classes & trying to register it as a service which is giving me an error.

Alexey Matveev
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, 2018

You write a script and put in in JIRA_HOME/scripts directory. Then you create a service according to this guide

https://scriptrunner.adaptavist.com/latest/jira/services.html

Suggest an answer

Log in or Sign up to answer