I would like to perform some type of automation action everytime an issue is added to a sprint. How can I do this with Automation for JIRA?
You can create a rule using the comparator condition (see our full list of rule components) and smart-values:
Project automation - Code Barrel JIRA 2016-09-21 10-00-27.png
When an issue is added to a sprint, we can use the 'issue updated' trigger to detect this. Then we use the comparator condition to check that the "Sprint" field was changed to a value (i.e. "does not equal Empty").
To access the changelog value we changed to, we can use this smart-value completion:
{{#changelog.Sprint}}{{toString}}{{/changelog.Sprint}}
Thanks @Andreas Knecht - Is there a way to further filter to only sprints that are active (i.e., have been Started)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update - the sprint field contains an object which contains the correct data:
{{issue.fields.customfield_10102}} (our 'Sprint' field)
yields
[com.atlassian.greenhopper.service.sprint.Sprint@15cdc97[id=138,rapidViewId=163,state=FUTURE,name=SPRINTNAME,goal=,startDate=<null>,endDate=<null>,completeDate=<null>,sequence=138]]
Is there a way in the rule to reference into this object to get the state field?
Alternately we could just regex for
state=ACTIVE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Matthew - so yes you're absolutely right - when an issue is being added to a sprint, then the custom field will contain the string above, which you can match against with a regular expression.
Unfortunately there's no way to get JSON for this customfield in the webhook we receive from JIRA. I've raised a support request for this, which should hopefully result in a bug being raised on jira.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 know this is a very old thread, but I wanted to know if anyone figured it out?
I would like to access the "end date" in that custom field within Automation for JIRA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@andreas this doesn't seem to work. When We use Advanced Compare Condition, the rule doesn't work.
This is the first value: {{issue.fields.customfield_10702}}
Condition: contans regular expression
Regular expression: (state=FUTURE)
This value: {{issue.fields.customfield_10702}} returns the name of the sprint, but not the state of it and not the string that was posted by @Matthew Vanderzee
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.