Using smart values to show quarter Q1,Q2,Q3,Q4

Rodrigo Xavier
Contributor
August 23, 2023

Hello everyone, how are you all?


I need your guidance.
I was researching smart values to work with quarter data.
With the help of AI (ChatGPT and Bard) these formulas were generated
{{issue.createdAt | date_format('Q')}}
{{issue.createdAt | date_format('Q/YYYY')}}
{{(now.getMonth() + 2) / 3}}

Apart from this last one, the rest didn't give an error but it doesn't work either.
How can I get this result.


Another doubt, would be the possibility of creating two variables with a value in text, example "AUDITORIA" and "AUDITORIA 1".
Make a rule and leave this variable in the summary?
My idea is depending on the type of issue the summary would look like this
[AUDIT] - Item name - Q3
[AUDIT 1] - Item name - Q4

Was my doubt confused did you understand what I need?

1 answer

1 accepted

4 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 23, 2023

Hello @Rodrigo Xavier 

Rather than relying on AI to get your answers I recommend that you refer to the Atlassian documentation. This page provides information about functions you can use with date and times in smart values.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#--

From that page and the reference it includes to another page about Java documentation for formatting dates, you can find that to get the number for a Quarter based on a date you would use this:

{{<dateField>.format("Q")}}

 

You can create variables in Automation Rules with the Create Variable action.

https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Create-variable

You can use an If/Else block to check the Type of the issue and modify the Summary of the issue based on its Type.

https://support.atlassian.com/cloud-automation/docs/jira-automation-conditions/#If-else-block

You can use the Edit action to edit the fields in your issue. If you want to add text to the Summary while keeping the original text you would do something like this:

Screen Shot 2023-08-23 at 9.17.39 AM.png

Rodrigo Xavier
Contributor
August 24, 2023

Hi @Trudy Claspill , sorry for the delay in responding and thank you very much for your collaboration.
I've seen these documentation, actually I don't trust the AI I just use it for verification if I'm on the right path.
As I am not a native English speaker, I have difficulties interpreting the documents, which makes it a little difficult for me. And to not be open to unnecessary things, I do this research with the AI.
I used the following format {{now.format("Q YYYY")}} but it generated an error.

About the name I created this variable with the two values. Then I call it inside the summary
{{name.get("name1")}} but it threw an error too.

Capture.PNG

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 24, 2023

What errors did you get? If the errors are not in English can you paste the text of the error here so that I can copy and paste it into a translator?

 

Can you show us the full automation rule?

 

Can you also show us the Audit Log information for when the rule ran?

Rodrigo Xavier
Contributor
August 29, 2023

Hi @Trudy Claspill, sorry for the delay in responding. I have some problems here in my service. I already got it here.
I did it in a test environment and it worked.
Now I don't know what the problem was because I used the same formula.
{{now.format("Q YYYY")}}
And it showed the error
Error rendering smart values when running this rule:
Failed to get value for {{now.format("Q YYYY")}}: IT Control Testing for quarter {{now.format("Q YYYY")}}

My automation is doing the following.

  1. Create an epic every quarter
  2. Create some checklisted tasks inside the epic
  3. Add [audit] to the summary according to the task type
  4. Assign tasks to those involved
  5. Forwards information about tasks via MS Teams and email
  6. Follows up tasks without interaction via MS Teams

I really appreciate your help my friend. Thank you very much.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 29, 2023

Please show screen images showing the entire rule.

Please show the details of the step in the rule where you are using the formula.

Please provide a screen image showing all the messages in the Audit Log for an execution of the rule where you got the error.

Suggest an answer

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

Atlassian Community Events