JPD Automation to transition Project Status when End Date has passed

Blake Elliott February 20, 2024

Hi there,

In our Jira Product Discovery project I have a custom field for the "End Date" that includes a start and end date. Ex:

cf[11979] = {"start":"2024-03-01","end":"2024-03-31"}

I am attempting to create an automation to change a project's status color from green or yellow to RED once the "End Date" has passed.

When trying to create the automation:
When: Scheduled 
Then: Edit Issue (To change the project status to RED)

I am getting hung up in the JQL due to operators not being supported by the custom field:

project = "My Project"
AND status = "Project in Progress" AND status not in("Project Closure")
AND cf[11979] ~ "> -1d"

My first thought was to change the custom field to include the End Date only and have a separate custom field for the start date.

With Admin permissions I am unable to:
a.) Locate the custom field to edit except for tracking down the JSON code for a clue using

https://<yourinstance>.atlassian.net/rest/api/3/field resulting in this code:

{"id":"customfield_11979","key":"customfield_11979","name":"End Date","untranslatedName":"End Date","custom":true,"orderable":true,"navigable":true,"searchable":true,"clauseNames":["cf[11979]","End Date"]


My second thought was to find a way for the JQL code right to just pull the "end":"[Date]" for purpose of the automation (see underlined below)

cf[11979] = {"start":"2024-03-01","end":"2024-03-31"}

Alas, no progress in either direction. Has anyone else ran in to this during automation?


2 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
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.
February 20, 2024

Hi @Blake Elliott 

There are several similar posts in the JPD community area with customers trying to use this new "date" field layout created by JPD team.  Until they add support to automation and JQL for this field type...

Others have been successful extracting the date needed (start or end) from the custom field using text functions, and then converting with the toDate function:

https://support.atlassian.com/cloud-automation/docs/examples-of-using-smart-values-with-dates/#Converting-text-to-dates

After that you should be able to perform the comparison to {{now}}

Kind regards,
Bill

0 votes
Stephen_Lugton February 20, 2024

You could:

(1) Setup smart variables:

 

StartDate:

{{issue.cf[11979].match("(\d{2,4}-\d{1,2}-\d{1,2})").first.toDate("yyyy-MM-dd")}}


and


EndDate:

{{issue.cf[11979].match("(\d{2,4}-\d{1,2}-\d{1,2})").last.toDate("yyyy-MM-dd")}}}}

 

Then JQL for if:

{{EndDate}} > now()

 

Thanks to Chad Nauman for this

---

(2) use the built in Project Start and Project Target fields

TAGS
AUG Leaders

Atlassian Community Events