Hello, good morning everyone!
I would like to achieve something in Jira. Specifically, I want the "Target End" value in my Epic to be copied as the maximum value from the linked subtasks.
In other words, I want the Epic to take the latest or maximum date from the linked tasks, which are of type "Story" and appear as issues in the Epic. I would like this value to be copied into a custom field within my Epic task.
The reason for this is that the tasks linked to my Epic have different dates, and I would like to get the latest or maximum date and copy that value to a custom field in my Epic task. How can I achieve this?
You describe trying to update the Target End date field in an Epic using the maximum value of the child issue Stories.
As you are using Jira Data Center, I believe there is only one way to do that to get the value: calling the REST API to access the maximum value for the edit.
For Jira Cloud, this is easy as the Lookup Issues action supports all issue fields. That is not the case for the Data Center version: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877
There are two possible workarounds for this scenario, depending upon what is needed for the value. You need the second one...
1) When the rule has no branches, or just needs to report on the field value, such as with an email or Slack message, the bulk-handling feature of the Scheduled Trigger or branches can help: https://confluence.atlassian.com/automation/run-a-rule-against-issues-in-bulk-993924653.html
In this case, one replaces the {{lookupIssues}} smart value with the plural {{issues}} one.
2) When the rule already has a branch or needs to edit an issue, one may instead use the Send Outgoing Web Request action to call the REST API for an issue search with JQL. Then use the web response smart value to sum the field.
Here is a how-to article for calling the REST API from a rule: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828
I believe this is the REST API endpoint you need: https://docs.atlassian.com/software/jira/docs/api/REST/9.13.0/#api/2/search-search
Finally, you may need to use the custom field id rather than the field name as a smart value. This how to article will help identify that value for your field: https://confluence.atlassian.com/automation/find-the-smart-value-for-a-field-993924665.html
Kind regards,
Bill
Thank you very much.
I followed the steps to obtain the information with the web request, but I still have the doubt about how to use this information to get the maximum value of the customfield and copy it to a field that I have in my current issue (where the automation is triggered). Could you help guide me?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First thing: the call to the REST API should be before the attempt to edit the issue fields.
Next, as you can see in the audit log, the issues are in the web response body, with the custom field under the fields attribute. That will return as text, and so must be converted into a date so the max function will work. Please try writing this to the audit log to confirm it matches what you expect:
{{webResponse.body.issues.fields.customfield_10904.toDate.max}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much!
I put this in the audit log: Prueba del log: {{webhookResponse.status}} {{webhookResponse.body.issues.fields.customfield_10904.toDate.max}} and it worked!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn that helped!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Diego Martínez
Your post tags say you are using a Cloud deployment which would indicate you are using Jira Cloud - the software as a service product.
But your tags also include jira-data-center.
Which product are you actually using?
If you click on the Help button in Jira and click About Jira, what information do you get?
Have you tried to create this rule? If so, please show us what you have so far.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Trudy Claspill
Yes, I'm using Jira data center, sorry.
This is an example of how I have tried to create the automation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also have this smart value
{{#issuesInEpic}}{{#if(customfield_10904)}}{{max(customfield_10904)}}{{/}}{{/}}
And I don't have lookupissues in this version of data center :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.