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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I check if an issue has been added to a Sprint with Automation for JIRA?

andreas Community Leader Sep 20, 2016

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?

1 answer

1 accepted

0 votes
Answer accepted
andreas Community Leader Sep 20, 2016

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)?

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
andreas Community Leader Nov 04, 2016

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.

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. 

@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 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

5 mobile apps for Jira Cloud to boost productivity

  It’s very important to have access to the workflow process from anywhere. Especially if you manage the work of others. There is no difference whether you’re out of office, or drive a ca...

249 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you