Not able to use automation for calculating project end date based on estimated hours and start date.
Seems that all possibilities for setting an project target date via automation are disabled, is this correct?
I would like to set the target date via automation based on project start date and estimated hours,
Hi @Paul Wijnen ,
Are you able to share some screenshots that help to illustrate what you're trying to populate? I'm looking at my own Product Discovery space, and I'm not sure I am understanding what the "End Date" you're trying to populate is.
Is that a custom field you've added to the space?
Robert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Paul Wijnen , thanks for sharing the details!
You should be able to populate that field with Automation, much like what @Hermance NDounga shared. I don't see "Project Target in any of my pre-built demo projects, so I assume that's a custom field you've created for your teams.
From what you stated before, I'm going to assume that you cannot find the "Project Target" field when you're building an automation rule. Specifically, you cannot find this when you configure the "Edit Work" action.
What we can do instead is leverage the "Additional Fields" options as part of this action, and attempt to populate the field that way.
I'm going to make a few assumptions:
What's strange is the Date field in Jira Product Discovery is actually two date fields, using the following format: {"start":"<DATE 1>", "end":"<DATE 2>"}
Here's how I would solve this.
{
"fields": {
"<PROJECT TARGET>": "{\"start\":\"{{<PROJECT START> .plusHours(<DEV EFFORT> * 100 / <AVAILABILITY RATE>)}}\",\"end\":\"{{<PROJECT START> .plusHours(<DEV EFFORT> * 100 / <AVAILABILITY RATE>)}}\"}"
}
}
--- or with the custom field IDs spoofed:
{
"fields": {
"customfield_10111": "{\"start\":\"{{issue.customfield_10222.plusHours(issue.customfield_10333 * 100 / issue.customfield_10444)}}\",\"end\":\"{{issue.customfield_10222.plusHours(issue.customfield_10333 * 100 / issue.customfield_10444)}}\"}"
}
}
That should do it! Give that a try and let me know how it's working.
Here's a screenshot of my example, without the more complicated maths.
Robert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, @Paul Wijnen , after some additional testing, here's my updated recommendation:
We should use multiple "Create Variable" entries to simplify the automation and JSON entry.
Create a "Create Variable" action to capture the current Project Start date.
We will use the substring command to pull the first date out of this entry. Let's call this variable "projectStart".
{{issue.customfield_10540.substring(10, 20)}}
Create a "Create Variable" action to capture the additional hours and availability rate math.
We will use the math command to calculate the new number of hours based on the Dev estimate, and the availability rate. Let's call this variable "addHours".
{{#math}}{{issue.customfield_devhours}} * 100 / {{issue.customfield_avail-rate}}{{/}}
Create a "Create Variable" action to capture the new Project Target date value.
We will use date math to add the number of hours to the start date, and then only keep the date itself (not the leftover hours). Let's call this variable "projectTarget".
{{projectStart.toDate.plusHours(addHours.asNumber)}}
Then, in the JSON for the edit, we can simply enter the variable instead of the long math additions.
{
"fields": {
"customfield_10539": "{\"start\":\"{{projectTarget}}\",\"end\":\"{{projectTarget}}\"}"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On another thought, you could adjust the math and "add hours" actions to be focused on days instead, and then round up to ensure you're looking at the next whole day.
The math would become
{{#math}}{{issue.customfield_devhours}} * 100 / {{issue.customfield_avail-rate}} / 24{{/}}
and the ".plusHours()" changes to ".plusDays({{addDays.round()}})" or ".plusDays({{addDays.ceil()}})". Round will round up using standard rounding logic, ceil will go to the next whole number, regardless of decimal.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paul,
Dates fields can be populated via automation, but you need to be aware of their specific formatting : https://support.atlassian.com/jira-product-discovery/docs/manage-automation-templates/
However, in your case, I don't think it would be possible to populate a date based on two other fields.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Hermance NDounga , these date fields should be able to be manipulated and calculated based on the existing date math that Automation is able to address, no?
The JPD Date field is a little strange, and will need to be manually set via the JSON formatting I shared in my other response to this question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Robert,
I'm clearly no JSON nor math in automation expert, to be honest so I really thought that wasn't possible.. I'm so glad it is. Thanks so much for taking the time to explain how to set these up and helping the community !
Best Regards,
Hermance
Sr. Product Manager @ Jira Product Discovery
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert, @Robert DaSilva
What im trying to do is calculate the project target date based on the project start date, the development effort in hours and the availability rate (70% available capacity)
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.