Forums

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

Setting a JIRA Date Field from a JPD Date Field

Betany Riley
Contributor
February 3, 2025

Hi All! 

I am trying to write an automation where a Start Date in JPD is copied over to the JIRA Start Date field when the Delivery ticket is spun up.  I have followed along THIS link which talks about string processing but have been unable to successfully get the date set on my JIRA ticket from JPD.  PRD Start Date is coming from JPD and is cf107178.  I did make sure that his automation was a global automation since it spans two projects.  iScreen Shoter - Google Chrome - 250203171035.png

When the rule runs, I receive a "Success" Message in my audit log, but nothing is actually in the PRD Start Date (JIRA) field in my JIRA project. iScreen Shoter - 20250203171200266.png

1 answer

1 accepted

0 votes
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.
February 3, 2025

Hi @Betany Riley 

First, I recommend writing that smart value expression to the audit log, using the Log action.  That will help diagnose rules like this.

 

Next, your rule is trying to update an issue in a different project, and I hypothesize your rule has a single-project scope in the details at the top of the rule.

The scope must be multiple-project or global to make the edit.  (I recommend multiple-project to limit / narrow the scope for rules like this).  Please work with your Jira Site Admin as they will need to help change the rule scope in the global rule settings.

Kind regards,
Bill

Betany Riley
Contributor
February 4, 2025

Hey @Bill Sheboy ! Thanks for the quick response and pointing out a piece of information I should have added to the main ticket.  I did make sure that this automation was a global automation.  I will add that to the description. 

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.
February 4, 2025

Thanks for that info, @Betany Riley 

Would you please post the complete smart value expression used to update that date field?

Also, is the PRD Start Date (JIRA) field a date-picker field type, configured in the global (i.e., company managed) settings?

Betany Riley
Contributor
February 5, 2025

Hi @Bill Sheboy !

SmartValue Expression: {{destinationIssue.customfield_10718.substringBetween("\"start\":\"","\",\"end\"")}}

 PRD Start Date (JIRA) field is indeed a date-picker field. 

I did add a "Log" to the automation, and the log was empty.  So that tells me the automation isn't picking up the value from JPD (cf_10718)

I also added myself as the actor on the automation in case there was a permset issue. 

iScreen Shoter - Google Chrome - 250205153529.pngiScreen Shoter - Google Chrome - 250205153602.png

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.
February 5, 2025

Ah, the smart value {{destinationIssue}} only applies with the link-related triggers: https://support.atlassian.com/cloud-automation/docs/jira-automation-triggers/#Issue-linked

 

You appear to be getting the date from the trigger issue, correct?  If so, please change to this:

{{triggerIssue.customfield_10718.substringBetween("\"start\":\"","\",\"end\"")}} 

 

Like Betany Riley likes this
Betany Riley
Contributor
February 5, 2025

OH MY GOODNESS!!!!  That was IT! Thank you so much for walking me through this!  I never thought about using trigger issue as I was in the "linked Issue" branch!  Thanks Again @Bill Sheboy !

Like Bill Sheboy likes this
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.
February 18, 2025

Hi @Betany Riley 

FYI...

The JPD dates are formatted as JSON, although they are recognized as text in rules.  With the new function jsonStringToObject(), the dates may be more easily accessed with their attributes.

For example, this would access the "start" attribute: 

{{jsonStringToObject(triggerIssue.customfield_10718).start}}

And if you needed a different date format, the text may be converted to a date then formatted as needed: 

{{jsonStringToObject(triggerIssue.customfield_10718).start.toDate.jiraDate}}

 

Kind regards,
Bill

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events