Have a script that will add a new Component to a project from an Automation. It works well when I hard-code the parameter values. Btu I can't get it to plug in smart values from the Automation.
This doesn't work:
Hi @Dan Knapton
So you are executing a scriptrunner script withing an automation rule?
Smart values are very specific to automation rules. They do not exist in groovy/ scriptrunner scripts even when using the scriptrunner action.
Here is some documentation: Execute a ScriptRunner Script
you can simply use:
def summ = issue.summary
Assuming your rule is being triggered by an issue event and you need that issues's summary.
Thank you that worked perfectly.
I had reviewed that <slim> documentation about smart values on that page and it seemed to indicate I needed the mustaches. All examples I could find had hard-coded values in single quotes.
Would you know how to reference project smart values in a script in Automation? ie. project id or key
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're welcome! Glad I could help.
Would you know how to reference project smart values in a script in Automation? ie. project id or key
Is this also for a rule being triggered by an issue? In that case issue.getProjectObject().key or issue.getProjectObject().id should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
from scriptrunner documentation :
You can evaluate smart values using ruleContext.renderSmartValues(String)
, for example:
log.warn ("Initiator of the action was... " + ruleContext.renderSmartValues('{{initiator}}'))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.