Forums

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

Copy DateType Custom field from JDP to Jira

Sushil Ranjan
Contributor
June 27, 2025

I am setting up an automation to sync or copy date fields between a Jira Discovery (JDP) project and JSM project.
So far, I am able to successfully sync the date from the JSM to JDP, but encountering issues when trying to sync from JDP to JSM

JSM FieldName : Deadline // customfield_11307
JDP FieldName : Deadline DP  //customfield_11308

I understand that date field in JDP is 'actually an array of two text values representing dates (start & end)' therefore we cannot use JIRA date field on JDP, so I created JDP global field 'Deadline DP'. If there is a supported method to use a standard Jira date field directly within JDP, please do correct me.

Below is the automation for JDP -> JSM, I have separate working rule for JSM-> JDP.
trigger: Value changes
branch: for linked issues
Log action: Extracted start: {{triggerIssue.customfield_11308.substringBetween("start\":\"","\",\"end")}}
edit issue:
{
"fields": {
"customfield_11307": "{{triggerIssue.customfield_11308.substringBetween(\"start\":\"\",\"\",\"end\")}}"
}
}

Log action shows extracted date, but fails to update JIra field
image.png
image.png
I have tried other options like:
{
"fields": {
"customfield_11307": "{{triggerIssue.customfield_11308.match(\"\\\"start\\\":\\\"(.*?)\\\"\").get(0)}}"
}
}
Audit log:
Error editing issues
TP-218 (The Deadline must be of the format "yyyy-MM-dd" (customfield_11307))
Issues edited successfully
TP-218

Any help or clarification is appreciated.

Thanks,
Sushil

2 answers

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
June 27, 2025

Hi @Sushil Ranjan 

Your JSON expression likely has problems due to the nested, double-quotation marks.

 

The JPD date format is JSON stored as text, and with the recently added jsonStringToObject() function the values may be extracted:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#jsonStringToObject--

For example:

{{jsonStringToObject(issue.customfield_12345).start}}

That value will be text.  When you need an actual date / time value, add toDate at the end of the expression.

 

Kind regards,
Bill

Sushil Ranjan
Contributor
June 30, 2025

Thanks for the help Bill, it worked.
{
"fields": {
"customfield_xxxx": "{{jsonStringToObject(triggerIssue.customfield_yyyy).start.toDate}}"
}
}

Like Bill Sheboy likes this
1 vote
Joel Tan June 29, 2025

is the JPD team planning to improve and introduce a way to have actual date format instead of string in the JQL export?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events