Forums

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

Get deleted issue information from Scriptrunner script

Alberto Rodríguez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 14, 2024

Hello everyone,

 

I have set up an automation rule that triggers on the "Issue Deleted" event, and consequently, among other actions a Scriptrunner Groovy script is executed to remove that issue key value from a Select List customfield.

The problem is that within the script, the 'issue' variable is null, even though I can access its key from the rule. Is there any way to pass that issue-related information from deleted issue to the Groovy script?

Scriptrunner listener is another option, but I want to know if this is possible with Automation.

Thanks!

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Alberto Rodríguez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 21, 2024

After consulting with Scriptrunner support, I reply to myself.

The solution consists of evaluating Smart Values from the script using the 'ruleContext' binding variable as follows:

ruleContext.renderSmartValues('{{issue.key}}')

You can also create custom variables from Automation and retrieve them in the script in the same way.
This is documented here: link to documentation

TAGS
AUG Leaders

Atlassian Community Events