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,456,290
Community Members
 
Community Events
176
Community Groups

Automation to Sync Dates Between an Initiative in JIRA Software and an Idea in JIRA Product Delivery

I've been working to setup JIRA Product Discovery for my group, and everything has been great thus far. 

We use initiative tickets as parents to epic tickets, and we're using JIRA Product Discovery in our Product Team for Roadmapping, Prioritization, and Discovery. 

I have setup a handful of automations that keep our initiative tickets that are linked delivery tickets in-sync with their idea counterpart. 

However, I can not figure out how to get a date field to stay in-sync. I believe it has something to do with how dates are stored in JPD. 

I tried using a custom JSON, because I couldn't target the date field in the simple automation UI.

{
"update": {
"customfield_10772" : {
"set" : {
"{{triggerissue.customfield_10742}}"
}
}
}
}

 This should work but I get an error:

 

Error while parsing additional fields. Not valid JSON.
I believe this is because the field is returning the following based on some logging I setup
{"start":"2023-01-28","end":"2023-01-28"}
I'm honestly not sure to go from here because I can't figure out how to get the field to format correctly to be accepted by a custom date picker in JIRA Software and vice versa with a field coming from JIRA Software going into Jira Product Discovery

I'm trying to get the date fields to sync for better roadmapping and preventing our PMs from having to do double the work between JIRA Software and JIRA Product Discovery. 

Screenshot 2022-12-08 at 12.05.59 PM.pngScreenshot 2022-12-08 at 12.06.15 PM.png

1 answer

1 vote

@Mike Gargano I've asked an engineer on the team to give more details about the format the field excepts. 

Martin Sturm Atlassian Team Dec 13, 2022

Hello @Mike Gargano , the date field in JPD accepts a JSON string with the start and end property being ISO 8601 date strings.

This is because JPD dates are conceptually intervals as we allow for example values like "Q3 2023" or "Feb 2024".

Like Steffen Opel _Utoolity_ likes this

Hey @Martin Sturm , I appreciate you taking the time to respond.

So how would I parse that in JSON coming in from JIRA Software? or going from JIRA Product Discovery to JIRA Software which is setup differently.

I don't think I've ever run into anything like this, I'm not sure how to write the JSON for this, and I couldn't find anything using my google-fu.

Martin Sturm Atlassian Team Dec 13, 2022

Hello @Mike Gargano , unfortunately I am not very versed when it comes to A4J - what exactly are you getting from JSW?

If it's a string in YYYY-MM-DD (or you can convert it into such a string) would you be able to create a JSON string like this?

{
start: $dateString,
end: $dateString,
}

Then you could set the field with this string and it would show up in JPD correctly as a "date with day granularity".

Like # people like this

Hey @Martin Sturm , thank you for your response, I apologize for my delayed reply, I got kinda busy towards the end of the year. I will give this a try and report back with how it goes! 

Like Martin Sturm likes this

Hey @Martin Sturm 

I tried this: 

 

{
"update": {
"customfield_10742": {
"set" : start: {{triggerIssue.customfield_10772}},
end: {{triggerIssue.customfield_10772}},
}
}
}

And I'm still getting an error "Error while parsing additional fields. Not valid JSON."

I tried formatting this a couple different ways. This also didn't work. 



"customfield_10742": {
start: {{triggerIssue.customfield_10772}},
end: {{triggerIssue.customfield_10772}},
}

Martin Sturm Atlassian Team Jan 16, 2023

Hello @Mike Gargano - as I said, I am no expert on this matter, but can you do some kind of string concatenation or a JSON.stringify on the value side of things?
Because if I interpret your code correctly you would end up trying to set a string based custom field with an JSON object, right?

 

"customfield_10742": JSON.stringify({ 
start: {{triggerIssue.customfield_10772}},
end: {{triggerIssue.customfield_10772}},
}

and maybe the YYYY-MM-DD conversion for the value that you mentioned above already.

@Bopanna from our support team just found a workaround for this I believe!

He just shared this with me, and I believe it should help you @Mike Gargano 

----

 

I tried to have a go at this by creating an automation rule and using advanced JSON editing to populate the JPD Date field. I was able to set the date using the below JSON format:
{
    "fields": {
        "customfield_10637":"{\"start\":\"{{now.jiraDate}}\",\"end\":\"{{now.jiradate}}\"}"
}
}
If we use {{<date>.jiradate}}, we should be able to format it to yyyy-dd-mm format as mentioned here

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events