How to create an automation to update a custom date field in Product Discovery

Leah Maggin November 21, 2023

I am trying to create an automation that will automatically set my custom field 'Target Finish Quarter' to be the value of the 'Target Start Quarter' in my Jira Product Discovery project.

First - I can't seem to find where the custom ID is for custom fields created in Product Discovery. 

Second: This is what I have set in the advanced field editing but it doesn't work.

 

{"fields": {"Target Finish Quarter": [{"id": "{{issue.TargetStartQuarter}}"}]}}

 

Screenshot 2023-11-21 at 4.39.48 PM.png

2 answers

1 vote
Rohan Swami
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 22, 2023

Hi @Leah Maggin . Looks Bill has been able to troubleshoot your Automation. I'm a Product Manager from the Jira Product Discovery team, would you be willing to have a quick chat with me on Zoom about your use case? Maybe we can find a solution that doesn't require automation. Here's my Calendly link to book time in with me.

1 vote
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.
November 21, 2023

Hi @Leah Maggin 

To find the smart value (or custom field id) of any fields which automation rules support, please try using this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Essentially you identify an example issue with your field, call a REST API function with a browser tab, and then search for your field on the page, such as with CTRL-F.  If you find your field, the smart value and custom field id will be present.  If not, the field is not supported by rules.

 

Next, "date" fields in JPD are actually an array of two text values representing dates...or at least that is what automation rules can see.  (There isn't a lot of documentation on what does / does not work for automation rules and JPD.)

If those are both JPD "date" fields, I recommend first trying to set it directly by selecting the field from the drop-down list (in the Edit Issue action) and entering the smart value for the "Target Start Quarter" field's custom field id.

If that does not work, review what you saw in the how-to article for the field format, and then use the same to set it with advanced edit with JSON.  An example I saw for a JPD "date" field looked like this, which is essentially all text:

"customfield_12345": "{\"start\":\"2023-10-18\",\"end\":\"2023-10-18\"}"

And so you would need to try building it the same way from the source field.

Kind regards,
Bill

Leah Maggin November 22, 2023

 

I did find the custom ID for the fields (I am surprised there isn't a simpler way to do this). Then I added in your formatting to try to just set the date of the other field but am getting back the below error.

 

Screenshot 2023-11-22 at 10.30.48 AM.pngScreenshot 2023-11-22 at 10.30.54 AM.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.
November 22, 2023

My apologies as I only listed the field specifics, and not what would be used for JSON edit of the field for that rule action.  Please try this:

{
"fields" : {
"customfield_10154": "{\"start\":\"2023-10-18\",\"end\":\"2023-10-18\"}"
}
}

The full documentation on such edits is here: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/

Like Steffen Opel _Utoolity_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events