How to create an automation to update a custom date field in Product Discovery
Asked by Leah Maggin:

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](https://community.atlassian.com/t5/image/serverpage/image-id/293067i0B1DA3BA66F3A072/image-size/large?v=v2&px=999 "Screenshot 2023-11-21 at 4.39.48?PM.png")


Answers:
author: Rohan Swami
body: Hi [@Leah Maggin](/t5/user/viewprofilepage/user-id/5284373) . 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](https://calendly.com/rswami-atlassian/customer-calls) to book time in with me.


author: Bill Sheboy
body: Hi [@Leah Maggin](/t5/user/viewprofilepage/user-id/5284373)

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

comments: author: Leah Maggin
body: 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.png](https://community.atlassian.com/t5/image/serverpage/image-id/293237i07F8191AD4AB7C17/image-size/large?v=v2&px=999 "Screenshot 2023-11-22 at 10.30.48?AM.png")![Screenshot 2023-11-22 at 10.30.54?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/293238i37D64D3AFF886E49/image-size/large?v=v2&px=999 "Screenshot 2023-11-22 at 10.30.54?AM.png")


author: Bill Sheboy
body: 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/>