Automation of dates based on several values in a custom field

Lcrawford
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 3, 2025

Hello!

We have a Program Increment field on our tickets that we use to assign work to a PI.  For Features, it's one to one. But, for Epics, they can span multiple PIs.  

Example: 

ABC-123 (Epic) is going to be ideated on and developed starting in PI 1 and target dev done in PI 4. 

ABC-124 (Feature) will be completed in PI 3. 

Our PIs (of course) have start and end dates. For simplicity, let's assume PI 1 is 1/1-1/31, PI 3 is 3/1-3/30, and PI 4 is 4/1-4/30.

What we want to automate is setting the target start and target end dates based on the PIs in the custom Program Increment field. 

So, For ABC-123, we want the automation to set Target Start as 1/1 and Target end as 4/30. 

For ABC-124, we want the Target Start as 3/1 and Target End as 3/30.  

If a PI is added or removed, we'd want that to update. 

I'm sure with coding this is possible...is it?  Has anyone done this before? 

Thanks for any help!

 

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 3, 2025

Hello @Lcrawford 

Welcome to the Atlassian community.

The tags on your post indicate your deployment is Cloud, which indicates you are using Jira Cloud (the Software as a Service product hosted for you by Atlassian). But then you added a tag for jira-data-center, which would indicate you are using the self-hosted product. Which are you actually using? When you click on the Help button (the question mark) near your avatar and then select About Jira, what version information do you get?

 

What type of entity is a PI? Is it another issue type?

In what type of field in your Epics are you recording the related PIs?

Lcrawford
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 3, 2025

It's data center; I went to edit it and couldn't swap it, which is why I added the tag. I miss the features in Cloud, but here we are. :) 

PI is a custom list field that allows multi-select. It is on the Epic and Feature screens, as are the Target Start and Target End date fields. 

Thanks for replying!

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 3, 2025

Thank you for that additional information.

Where is the information about the start and end dates of the PIs?

Lcrawford
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 3, 2025

I'd likely have to put it in the code; it's not stored like release start and end dates are, and we don't release each PI to make it easier, unfortunately.  I am limited on admin rights with this contract, but am open to ideas.

I usually do a workaround and import a file and use EazyBI for the reporting, but we have a need to have the data on the ticket and pushed into our Roadmunk integration. 

 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 3, 2025

What values are available in the PI selection list?

Would the admins consider updating the selection list values to include start and end data; i.e.

PI1 2025-01-01 2025-03-31

Have they considered creating PIs as a new issue type where the dates could be recorded in date fields, and using an Issue Picker field or generic issue linking to create the relationship between Epics and PIs?

What version of Jira Data Center are you using?

Lcrawford
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 3, 2025

We could do the appending of the dates, but that would likely clutter up all of our other reporting that we do.  It's a heavily used field that has customer facing reports pulling from that field.  

Getting a new issue type would honestly take about 3-6 months.  It's the first time I haven't been a system admin and I'm feeling it!

If we did the type approach, then automation could grab from that PI ticket and update the epic or feature? Is that the thought process?  

We are on:

Jira v9.12.15

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 3, 2025

With PI being an issue type it would be possible to use a Lookup Issues action in an Automation rule to retrieve the linked PI issues for an Epic. You could either use the ORDER BY clause in the Lookup Issues JQL to order them by a date field and get the date from the first or last issue in the results set, as appropriate, or you may be able to use the min/max functions on the date fields to get the earliest/latest as appropriate.

One of the rules could be something like

WHEN: field value changes for Target Start or Target End
IF: issue type is "PI"
BRANCH: Linked issues using link type "X"
IF: issue type is Epic
THEN: Lookup all PI type issues linked to the Epic where the PI issue Target Start is not empty
AND: Edit the Epic Target Start date to be {{lookupIssues.Target Start.min}}
AND: Lookup all PI type issues linked to the Epic where the PI issue Target END is not empty
AND: Edit the Epic Target End date to be {{lookupIssues.Target End.max}}

You might need additional rules to catch when a PI is newly linked to an Epic, or when a PI is unlinked from an Epic.

The min/max functions don't necessarily work with all fields, so I'm not positive it would work with custom date fields. If it did not then you could do something like this.

One of the rules could be something like

WHEN: field value changes for Target Start or Target End
IF: issue type is "PI"
BRANCH: Linked issues using link type "X"
IF: issue type is Epic
THEN: Lookup all PI type issues linked to the Epic where the PI issue Target Start is not empty and order by Target Start ASC
AND: Edit the Epic Target Start date to be {{lookupIssues.first.Target Start}}
AND: Lookup all PI type issues linked to the Epic where the PI issue Target End is not empty and order by Target End DESC
AND: Edit the Epic Target End date to be {{lookupIssues.first.Target End}}
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 3, 2025

If you have only the PI names (i.e. PI1, PI2, etc.) in that multiple select field, does the name imply which one has the latest end date and which has the earliest start date? Is there a way to look at the names programmatically to determine that, like they are named identically with an incrementing number so they could be sorted alphabetically to find the latest and the earliest?

As it is a multiple selection list figuring out what is and is not selected and then figuring out which among those would have the earliest and latest dates will be challenging. Off the top of my head I don't know a solution for that, so I'm not even sure if it is possible.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events