Hello,
I am struggling with an automation. Simple, I want to add today's date to a custom field. I used the doc here: Product demo: Automation for Delivery 🤖 - Atlassian Community
Here is my statement:
{"fields": {"customfield_10552":"{\"start\":\"{{now.jiraDate}}\",\"end\":\"{{now.jiradate}}\"}"}}
Here is the error I get:
Thank you for your help!
I believe it's because of the quotes surrounding the object that contains start and end props.
When I post your code into jsonlint.com, it shows this:
After I took those out, it also threw errors on the escapes, so try this?
{ "fields": { "customfield_10552": { "start":"{{now.JiraDate}}", "end":"{{now.Jiradate}}" } }}
BTW what kind of custom field type is this?
Commenting to track if anyone comes up with a solution to this one. My own investigation suggests it might be related to escaping special characters correctly, bbut I haven't been able to invest the time to look into it deeply.
Regards,
-C
I asked also a new friend, that sometimes, knows a lot. His name is chatGPT. It gave me the right formula and it works:
In your JSON, there is a small issue with the casing of the jiraDate placeholder. In Jira Automation, the correct casing for the current date placeholder is {{now.JiraDate}} with an uppercase "J" and "D".
Here's the corrected JSON:
{"fields": {"customfield_10552": "{\"start\":\"{{now.JiraDate}}\",\"end\":\"{{now.JiraDate}}\"}"}}
This JSON assigns the current Jira date to both the start and end properties within the customfield_10552 field.
Thank you Erin. I'm bookmarking this tool.
It's a date field in JDP.
I used the exemple provided by @Hermance NDounga in her documentation. Copy/Paste and changed the field number only.
It looks like you're new here. Sign in or register to get started.