You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hi,
I'm using Automation for Jira to run a Scriptrunner script. I need the value of the "initiator" of the rule in my script and I don't see a way to get it. One of the binding variables is currentUser but that is the Actor defined in the rule, not the person who actually triggered the automation rule.
Ultimately, I'm trying to send an email to the initiator. I can use the Send Email action and put "Initiator" in the To field and that works but I need to do some funky processing to build the body of the email - hence the need for a script to actually send the email. I can build and send an email in a script but I don't have the initiator to send it to.
(Man, I really wish we could pass values to, and get values back from, scripts in automation rules.) Anyway, is there a solution for this problem?
Thanks
So, it turns out that in version 6.16 of Scriptrunner, they added initiator as a binding variable.
Interestingly, they also deprecated errorCollection and gave us addMessage() and addError().
Hi @Tom Hudgins
Are these the smart values you need for the Initiator who triggered the rule?
{{initiator.displayName}}
{{initiator.emailAddress}}
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Those are the smart values but I need access to them in a Scriptrunner script - not in the automation rule itself. I basically need some way to pass them to the script.
I do have a kind of workaround for this - passing values to and from a script in an automation rule. I'm playing around with using the Send Web Request action to talk to a Scriptrunner REST endpoint. I can pass data to it in the REST call and get data back in the {{webhookResponse.body}} smart value.
The only small snag in this approach is the need to bake authentication information in the REST call.
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gotcha... You may want to search the developer forum to see if someone has solved this there: https://community.developer.atlassian.com/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm 80% sure that the smart values are not populated as binding variables. To be 100% sure, ask Adaptavist, developers of ScriptRunner.
(Some weeks ago we tried the same thing that you're trying, and couldn't find an answer.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks,
Yes, I did post a question to Adaptavist but figured I'd check here as well - they often refer me to here when they don't have a solution.
I'm pretty pleased with the solution of using the web request action to interact with a Scriptrunner script described in my previous response above. We have a service account that I'm using to authenticate so that solves that problem (mostly).
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey there Cloud Community members! We’re excited to give you the first glimpse of the new home for business teams on Jira — Jira Work Management. Jira Work Management is the next generation of J...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.