How do I set absolute date to Due Date with Automation's smart values

victor_kuzmychov March 22, 2024

I have a date in a form of string e.g. "05-05-2024" 

How do I set this as Due Date? I tried different takes on it but still can't find the right way. Documentation only describes how to set relative dates which is not my case

I tried so far:

{{05/05/2024}}

{{05-05-2024}}

{{"05-05-2024"}}

{{"05-05-2024".toDate.jiraDate}}

{{"2024-05-05".toDate.jiraDate}}

etc, non worked

3 answers

1 accepted

1 vote
Answer accepted
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2024

Hi @victor_kuzmychov 

This should work (assuming the string is in a text field):

  • Trigger: <trigger here>
  • Action: Create variable
    • Name = textToDate
    • {{issue.customfield_10123.toDate("dd-MM-yyyy")}}
  • Action: Edit issue
    • Field = Due Date
      • Value = {{textToDate}}

You'll need to...

  • Add an appropriate trigger
  • Update the custom field ID to match your text field
  • Ensure the date format matches (05-05 could be dd/MM or MM/dd)

---

Assuming I understood the need, let us know if this works!

Ste

victor_kuzmychov March 22, 2024

This sounds pretty close but still doesn't work yet

I will clarify my needs:

My date is coming not from a custom field but from a fixVersion name. I successfully extract that part by

{{issue.fields.fixVersions.name.substring(0,10)}} 

I know it works as I set this value to Description. 

I created a variable out of it and then set it to Due Date but I get error:

Failed to get value for issue.fields.fixVersions.name.substring(0,10).toDate("dd-MM-yyyy": {{issue.fields.fixVersions.name.substring(0,10).toDate("dd-MM-yyyy"}}
victor_kuzmychov March 22, 2024

I had error there ( ")" was missing)

Which I fixed and then I get error:

(The duedate must be of the format "yyyy-MM-dd" (duedate))

Even though I changed my format 

victor_kuzmychov March 22, 2024

Solution that works

{{issue.fields.fixVersions.name.substring(0,10).toDate.format("yyyy-MM-dd")}}

0 votes
Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2024

Hi @victor_kuzmychov,

There is something strange about your question. If you want to set a fixed date, you don't need to use smart values, you can just specify the date in the due date field in your automation rule:

Screenshot 2024-03-22 at 15.47.33.png 

But that would not make much sense as a requirement, wouldn't it? You would be entering the same due date every time. So something tells me you do need something dynamic after all. What am I missing here?

Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2024

If you want to copy the data of one custom field to due date, you need to reference that field in your smart value. Suppose your field is called "Some date", your smart value would look like this:

{{issue.Some date}}

(referencing the exact name of the field).

victor_kuzmychov March 22, 2024

I will clarify my needs:

My date is coming not from a custom field but from a fixVersion name. I successfully extract that part by

{{issue.fields.fixVersions.name.substring(0,10)}} 

victor_kuzmychov March 22, 2024

posted solution

0 votes
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.
March 22, 2024

Hello @victor_kuzmychov 

Why not use the Pick A Date option?

Screenshot 2024-03-22 at 7.45.33 AM.png

Suggest an answer

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

Atlassian Community Events