Forums

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

Print out the Resolved timestamp when the automation for reopening runs and send a email.

Sara Överström April 13, 2022

Hi community,

 

I have created a automation for reopening issues, and I want to add in the email we receive the Resolve date. But I can´t make that work in any way and can´t find any smart value that supports this function. I found the {{issue.created.mediumDate}} and it works, but I don´t want to see that.

Is there any other way to print out the Resolved date? Perhaps with JQL??..

I have tried these expressions:

issue.getResolutionDate("mediumDate")
{{issue.getResolutionDate()}}
{{issue.resolution.mediumDate}}


I hope there is a solution for this out in the community :) Thanks in advance for the help!

Best Regards,
Sara
 

1 answer

1 accepted

3 votes
Answer accepted
Tessa Tuteleers
Community Champion
April 13, 2022

hi @Sara Överström , 

you can use this format (or a lot of different ones). You can look it up here

{{issue.resolutiondate.asLongDateTime}}

{{issue.resolutiondate.format("dd/MM/yyyy")}}

Hope this helps! 

- Tessa

Sara Överström April 13, 2022

Hi Tessa,

Thank you for your help but it didn´t work, I don´t see any value:( I used both:
{{issue.resolutiondate.asLongDateTime}}

{{issue.resolutiondate.format("dd/MM/yyy")}}

It feels like it has something to do with that I have the Resoultion field will be cleared? :( reopen post funvtion.png

Tessa Tuteleers
Community Champion
April 14, 2022

Hey @Sara Överström , 

yes, this postfunction clears the date field, and the automation rule only runs after this so the date would be lost by then. 

You could do one of 2 things. 

  • Add a postfunction copying the date to another (custom) date field for later retrieval before you clear the resolution, and use that custom date field for your mail
  • remove the "clear resolution" postfunction from the workflow and clear it in your postfunction as an action after you first get the smart value. 
    (!) I wouldn't recommend this option as it will be difficult to make sure your rule runs everywhere the workflow is used, and those tickets won't have resolution cleared and thus stay "closed" in the eyes of the system. 

- Tessa

Like Sara Överström likes this
Sara Överström April 14, 2022

Hi Tessa,

Thank you so much for your answer and help :), I will try your first option to create a custom date field. Just so I understand right what you´re saying the steps are as follows:

Step 1: Create a custom date field

Step 2: Add the post function to copy the value of the resolution date before the post-function to clear the resolution date kicks in. 

Step 3: Adding it somehow to the automation action "Send email" where all my smart values are? I´m not quite sure how to do this part😳 Do you know if there is a tutorial about adding it to the "send email" action?

 

/ Sara

Tessa Tuteleers
Community Champion
April 14, 2022

Hi @Sara Överström , 

those steps seem to be correct. 

If you want to keep it clean, after sending the mail, you could clear the custom field again as an action, if you are only going to use that custom field for that action. 

In the page about date smart values I mentioned in my previous comment, there is also mention of how you can do that with a custom field. 

{{issue.MyDateFieldName.longDateTime}} or {{issue.customfield_12356.longDateTime}}

Try and experiment with the smart values a little (in automation you can use them anywhere, not just on mails so focus on the smart value documentation if you want more info on that) and remember that you can use a "log action" instead of a mail action for testing purposes, this is quicker and less context switching / waiting for mails etc is involved during debugging. 

- Tessa

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events