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.
{"start":"2023-01-28","end":"2023-01-28"}
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.
@Mike Gargano I've asked an engineer on the team to give more details about the format the field excepts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried formatting this a couple different ways. This also didn't work.
"customfield_10742": {
start: {{triggerIssue.customfield_10772}},
end: {{triggerIssue.customfield_10772}},
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
----
{ "fields": { "customfield_10637":"{\"start\":\"{{now.jiraDate}}\",\"end\":\"{{now.jiradate}}\"}" } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Tanguy Crusson , I tried this and the automation kicked back an error:
Error editing issues
FPD-304 (We couldn't save your changes. Copy your content, then try reloading the page.)
This is how I formatted the JSON:
{
"fields": {
"customfield_10742":"{\"start\":\"{{customfield_10772.jiraDate}}\",\"end\":\"{{customfield_10772.jiradate}}\"}"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Mike Gargano
Bopanna here from the Atlassian Cloud Support Team!
In order to investigate the error further on our end, I would kindly request you to raise a support ticket with us here, please: https://support.atlassian.com
Thank you!
Best,
Bopanna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After working with Marcelo on the Atlassian Support Team we were able to determine I was missing the TriggerIssue Smart Variable. The Solution ended up being:
{
"fields": {
"customfield_10742":"{\"start\":\"{{triggerIssue.customfield_10772.jiraDate}}\",\"end\":\"{{triggerIssue.customfield_10772.jiradate}}\"}"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome, thanks for letting us know @Mike Gargano ! I'll add this to the FAQ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am receiving an error when attempting to use the answer above. Asking for the proper formatting and then when I try to implement a short text field it posts a bit of the code rather than a date at all. Any suggestions
{
"fields": {
"customfield_12448":"{\"start\":\"{{triggerIssue.customfield_12447.jiraDate}}\",\"end\":\"{{triggerIssue.customfield_12447.jiradate}}\"}"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this on the feature roadmap? It seems so important to keeping the two systems in sync!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, the team's currently investigating that one actually 👍
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to all for the solution. It worked fine for me. I just wanted to share my automation, as I included not only the trigger, when the Project Target gets changed but also the trigger, if a new delivery ticket gets added to the idea.
a. checking that i am in the right project
b. branch that it changes the dates only on delivery issues of the idea
c. I restricted the update of the due date to specific types and projects. You can just leave that if you want to update the due date in every delivery ticket.
d. I worked with a smart value variable. The smart value I put in was (thats what Mike here postet last as solution):
{{triggerIssue.customfield_10081.substringAfter("\"end\":\"").substringBefore("\"")}}
e. put in the duedate in the related delivery tickets via edit issue advanced
{
"fields": {
"duedate": "{{endDate}}"
}
}
f: and in the end a litte log note to check what was inserted as the due date: via Log action:
Log message:
DueDate in UDO Epics set to: {{triggerIssue.customfield_10081.substringAfter("\"end\":\"").substringBefore("\"")}}
DONE :)
Whole picture:
a. Trigger is that a new ticket is linked (implements, is implemented by)
b. again I restricted the automation to a specific project. If you want to update every added delivery tickets just leave this step out
c. again worked with a variable:
Smart value is: {{destinationIssue.customfield_10081.substringAfter("\"end\":\"").substringBefore("\"")}}
as you can see here you have to work with destinationIssue and not with triggerIssue.
d: edit issue - issue due date to new linked delivery ticket
{
"fields": {
"duedate": "{{endDate}}"
}
}
e: and again a litte log note to check what was set as due date in the linked delivery ticket:
Log Message:
DueDate in new linked UDO delivery ticket set to: {{destinationIssue.customfield_10081.substringAfter("\"end\":\"").substringBefore("\"")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Katja Arendt ,
First thanks for all these tips! 🙏🏼
QQ - how did you find the id of the Project target field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've just found a "way" to find the custom field. This was suggested by @Tom Rouillard back in 2021: https://community.atlassian.com/t5/Jira-questions/How-do-you-find-a-field-ID-in-a-team-project/qaq-p/1710958
Do a JQL search using the custom field exposed as a column in the search result, and click on the custom field column to sort.
The JQL will automatically readjust the JQL to ORDER BY the custom field with its ID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, also one easy way, which I use all the time is described here
https://confluence.atlassian.com/jirakb/how-to-find-any-custom-field-s-ids-744522503.html
It is option 2:
you can just copy that link (
<JIRA_BASE_URL>/rest/api/latest/issue/BS-1?expand=names
)to your brower, insert your url and add it to your favorites in the browser.
For me it is the fastest way to find any custom field id of any field in any project. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.