Scriptrunner cloud listener 'context' variables

Fede B.
Contributor
June 21, 2024

Hi all,

 

I'm writing some listeners in SR cloud, to alert me when some interesting stuff happens.

I'd like to be able to retrieve, from some binding variable, the context of the script:

- which script is it? I didn't find a way to retrieve anything better than "this.class",  which is pretty useless to identify the script itself. I'd like my alerts to include a message like: "This alert comes from <script name or uuid here>"

- who triggered the listener? Sometimes I'm able to retrieve this info in a smart way, for instance if in a "comment deleted" listener, I can retrieve the last changelog author. But what about a "board deleted" listener? Or "project deleted"? I'd like my alerts to tell me who did the action that triggered the alert, so I can reach them and ask for explanations, when needed

 

Best regards,

Fede

2 answers

2 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Fede B.
Contributor
June 26, 2024

This is the answer that I received from an Adaptavist developer:

 

---
Based on the details, if you are looking into triggered events, you can use the listener's correlation ID and access the log from the script log. You can search for the logs from there based on the correlation ID. If you are looking for the user that triggers the event, you can access it from the execution history and within the payload tab.
---


So, apparently there's no way to retrieve the info from the execution of the script itself, and manually parsing the logs is the only solution (for now).

0 votes
Answer accepted
Dave Rosenlund _Trundl_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 21, 2024

Hi, @Fede B.. I moved your question to App Central, where questions about Atlassian Marketplace products should be posted. Also, I added some additional tags to hopefully draw the right eyeballs to your post.

 

That said, I suggest you contact the Scriptrunner support team directly for a faster/better response.

Best of luck,

-dave

Fede B.
Contributor
June 23, 2024

Thanks @Dave Rosenlund _Trundl_  for properly categorising my message :)

Like Dave Rosenlund _Trundl_ likes this
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events