Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,739
Community Members
 
Community Events
185
Community Groups

Embed Smart value date in description

Hello,

 

I'm creating a new Jira issue using Automation and would like to insert a date (with the calendar picker) in the description using markdown. I can get the date to be added as a string, but not as a calendar picker date. Here is what I've tried:

{{triggerissue.dueDate.jiraDate}} # Prints the date as string

{{{{triggerissue.dueDate.jiraDate}}}} # Specific date like {{2023-01-01}} is supposed to work as markdown but doesn't work using automation

{{ {{triggerissue.dueDate.jiraDate}} }} # Doesn't print the date

\{\{{{triggerissue.dueDate.jiraDate}}\}\} # Shows an error about invalid format

 

Is there any other way to handle this?

2 answers

0 votes
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 27, 2023

Hi @gsharma

So I thought @habib rahman might be on the right track with Advanced field editing using JSON, although in his examples he's not actually using the field where you would put JSON.

But nevermind all that.

I looked at the API endpoint (example, https://YOURSITE.atlassian.net/rest/api/3/issue/PROJECT-123) for an issue with a description that contains a date picker, and it looks like this:

"description": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "date",
"attrs": {
"timestamp": "1679875200000"
}
},
{
"type": "text",
"text": " "
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This is the date."
}
]
}
]
},

And well, I tried putting that in the correct place to enter JSON:

{
    "fields": {
        "description": THEJSONBLOCKFROMABOVE
    }
}

And unfortunately it looks like Advanced editing using JSON, at least when it comes to the Description field, does not support anything but strings, as I got this error:

HELP-51 (Operation value must be a string (description))

I also tried putting "This date: {date|03/27/2023}" as description in JSON and that also only resulted in the same thing you saw.

As far as I can tell, there was never any kind of {date} markdown macro for the date picker. I've checked the Internet Archive for this page:

And this one:

Sorry I don't have better news for you.

0 votes
habib rahman
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.
Mar 22, 2023

HI @gsharma My name is Habib I shall try my best to help you with the request:

Also, do check out Advanced field editing using JSON 

Jira Automation examples: https://community.atlassian.com/t5/Jira-articles/10-Jira-Automation-examples-to-get-you-started/ba-p/1060888


To insert a date (with the calendar picker) in the description using markdown in a Jira issue created using automation, you can use the Jira smart values to format the date.
Here's the syntax to include a calendar picker date in the Jira issue description:
```
{test=date|YYYY-MM-dd}
```
Replace "YYYY-MM-dd" with the format that you want to display the date in. For example, if you want to display the date in "MM/dd/YYYY" format, use:
```
{test=date|MM/dd/YYYY}
```
So, to include the due date of the trigger issue in the description of the new issue using the "MM/dd/YYYY" format, you can use the following automation rule:
1. Navigate to the Jira Automation section and click on "Create rule".
2. Give your rule a name and select the project/board you want to run the rule on.
3. Add the "Create Issue" trigger.
4. Fill in the required fields in the "Create issue" action, including the description field.
5. In the description field, use the following syntax to display the due date in the desired format:
```
The due date is {test=date|MM/dd/YYYY} 
```
6. Save the rule.
Screenshot 2023-03-22 at 21.41.08.pngScreenshot 2023-03-22 at 21.40.58.png

When a new issue is created using this automation rule, the due date from the trigger issue will be inserted into the description field of the new issue in the format specified in the Jira smart value. Advanced search reference - JQL fields 

If this helped please accept the answer as this could help others with the same issue as well. 
Thanks 

Habib.

Hi @habib rahman 

Thanks for the answer. I tried it, but it just prints "{test=date|YYYY-MM-dd}" in my description as it is.

I don't understand the logic here. What is "test" supposed to be? Is it a special string or the title of the current issue? I don't see it documented in the links you provided either.

Thanks for the help!

habib rahman
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.
Mar 22, 2023

HI @gsharma 

I don't understand the logic here. What is "test" supposed to be

Jenkins Jira pluginSorry "{test=date|YYYY-MM-dd} should be {jenkins=date|MM/dd/YYYY} But it was just a reference to how you can do this
The code {jenkins=date|MM/dd/YYYY} is a Jira automation rule expression that retrieves the current date and formats it to display in the specified format: month/day/year.
This expression is used in Jira automation rules to include dynamic content in notifications, comments, or other actions that occur when a specific trigger is met. 
In this case, the expression uses the "jenkins" variable to refer to the current date and format it as per the specified format string: MM/dd/YYYY. 
For example, if today's date is October 26, 2021, the expression would be expanded to display the date in the following format: 10/26/2021. This can be used in automation rules to include the current date in notifications or comments, or to timestamp actions taken on an issue using the current date.
Overall, the {jenkins=date|MM/dd/YYYY} code is a handy feature in Jira automation that allows users to add dynamic content and customize notifications and comments to fit their specific needs.

Thanks 

Thanks a lot for the help, but I'm not looking to integrate third-party plugins at the moment. I'm looking for something that can be handled by Jira Automation itself.

Suggest an answer

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

Atlassian Community Events