Jira Smart Values If Else Statement

Krzysztof Kiser
Contributor
November 12, 2023

Hey there,

I need to pass smart value in Jira Automation for it to set a date field based on the below conditions:

If customfield_10206 <= now.startOfMonth Then now.startOfMonth

Else now.plusMonths(1).startOfMonth

 

Is it possible to achieve this in smart values?

2 answers

0 votes
Muhammad Moazzam Hassan
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.
November 12, 2023

Here is the rule.

image.png

Muhammad Moazzam Hassan
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.
November 12, 2023

Use less than for your requirements

0 votes
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.
November 12, 2023

Hi @Krzysztof Kiser 

Without seeing your complete automation rule for context, I believe there are at least 2 ways to do this: use if/else conditions or use conditional, smart value expressions. 

What have you tried thus far to solve this?

Kind regards,
Bill

Krzysztof Kiser
Contributor
November 12, 2023

This is already part of another if/else statement within automation. I would like to use the smart value expressions, but I can't get it to work.

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.
November 12, 2023

I believe that is possible with a conditional, smart value expression: https://confluence.atlassian.com/automation/jira-smart-values-conditional-logic-1081351607.html  Such conditions only have "true" cases, not if/else, and so two expressions will be needed or you can combine this with a math expression: https://confluence.atlassian.com/automation/jira-smart-values-math-expressions-993924866.html

Please post images of what you have tried, and explain what is not working as you expect:

  • an image of your complete rule,
  • an image of the details of the action with your expression, and
  • an image of the audit log details showing the rule execution.

Those will provide context for the community to offer suggestions.

Suggest an answer

Log in or Sign up to answer