Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Scriptrunner cloud listener 'context' variables

Fede B_ 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_ 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
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_ June 23, 2024

Thanks @Dave Rosenlund  for properly categorising my message :)

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

Atlassian Community Events