Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to find and define the correct Smart Value

Hector Sibisi January 16, 2024

Hi!

I am trying to create a rule where for every ticket that is created, the automation should look at the date in which the issue was created as well as the start date of the sprint and make a decision. For example, if a ticket is created and put into the sprint on the first day, this rule should be bypassed, but if a ticket is created and put into an active sprint on any day AFTER the first, it should trigger the rule and make a decision (alert the reporter). 

We are looking at a specific custom field, "Type of Request". Tickets created after the first day of the sprint should have a specific type of request selection. But I cannot help but trigger the action regardless of the smart value, so I am not sure what is the issue. 

 

 

2024-01-16_16h43_13.png

1 answer

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 16, 2024

Hi @Hector Sibisi 

Please consider: you are trying to compare the issue's create date / time to the exact sprint start date / time.  That is unlikely to ever match, and so a greater than test would help.

And even better approach might be this:

  • Once a sprint starts, it becomes "active" and the issues in it can be found with JQL
    • project = yourProjectName AND sprint IN openSprints()
  • And so your rule could instead just check with a JQL condition rather than examining the date / time values

Kind regards,
Bill

Hector Sibisi January 16, 2024

Hi @Bill Sheboy 

Thank you for your response - sorry, I'm new to this, so I have follow-up questions. Would the JQL be able to determine the issue's create date to the sprint start date?

I am just trying to compare the date, not necessarily the time. Something like {{sprint.startDate}} is not equal to {{issue.createdDate}}

Is there a way to just compare the date and not the time?

Please expand on this.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 16, 2024

Yes: you could use the date / time difference function for that: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-difference---

Or, convert the values to text and then perform the comparison: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-format---

I still recommend the JQL approach for your scenario.  The reason is when an issue is carried over from one sprint to another (if it was not completed), the sprint field will then contain multiple sprint values.  It is not simple to identify the correct sprint in the field for the date comparison.

Like Walter Buggenhout likes this
Hector Sibisi January 16, 2024

@Bill Sheboy Thank you so much.

For this scenario, we are only considering newly created/updated issues, so the rollovers would stay as they are. But you've made me think of things I hadn't considered.

Also, I wonder if there is a scenario where we only look at the {{sprint.startDate}} regardless of whether the sprint is active. Sometimes, my team creates issues before the sprint starts and then updates the required fields, so it's possible that a ticket created will not be placed into an active sprint, but we still have to comment on the issue. Is JQL still the best way? Can you show me an example, maybe?

Here are checks:

- For Planned tickets, to check if the issue is created or put into the sprint on the first day of the sprint. 

I also looked at the abovementioned links and this is how I decided on the smart values for this, so please look at the attached image and let me know if I've missed something.2024-01-16_19h15_21.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 16, 2024

Just to clarify on the multiple sprints / carry-over issue: if your team clones issues and selects the checkbox to clone the sprint, the sprint value(s) will be propagated.

 

Using the JQL condition approach, I provided the JQL in my first response and the condition type to use is this one:

https://support.atlassian.com/cloud-automation/docs/jira-automation-conditions/#JQL

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events