Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to count the number of times Target end changed with Jira Automation?

Daniel McCollum January 22, 2024

As a pm, i need to know the number of times Target end (date field from Advanced Roadmaps) changed after the initial date i.e., subsequent changes to date field, which I think is standard and not custom.

Is this possible without intensive knowledge of api, or paid plugin, etc.?

Example is Target end field date changed x times since project began, and I'd preferably like to capture that count on a custom field within my Jira Cloud instance - note: do not need to count when field went from empty to initial date value.

I saw this post, but it somewhat lacked details.

3 answers

1 accepted

3 votes
Answer accepted
Michael Yaroshefsky - Visor for Jira
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.
January 22, 2024

Hi @Daniel McCollum ,

There was another answer to a question like yours that might be more helpful to you. 

In this post, the recommendation was to create a custom field, set the default value to 0 then make it read-only. From there, edit the issue fields and have "Due Date Tatteletale" set to:

{{#=}}{{issue.Due Date Tattletale}} + 1{{/}}

See the full post, here: https://community.atlassian.com/t5/Jira-Content-Archive-questions/Is-there-a-way-to-count-the-number-of-times-a-due-date-is/qaq-p/2269276

Alternatively, you can try searching for an issue history tracker on the Atlassian marketplace.

I hope this helps,

Michael

Daniel McCollum January 29, 2024

@Michael Yaroshefsky - Visor for Jiraappreciate your reply!  There is a field within Jira Cloud instance named Due Date, which is default/standard.  When looking at that solution, it's key to be mindful of that.  Reason for mentioning is whether the count works with standard versus custom field.  In my scenario, I need to read the number of times a date field called Target End (available through Advanced Roadmaps) and have that value populated on a custom field called e.g., "Target End Misses".  Within Jira Automation, the Target End field (again, available because of/through Adv. Roadmaps app) is not shown in search.

0 votes
Daniel McCollum February 13, 2024

I used the following statement in jira automation to count each time the date field in question is changed each time, which works perfectly when custom date field that records count is number type, which is editable:

 

{{#=}}{{issue.Target Date ABC}} + 1{{/}}

However, when I instead created a read-only text custom field to record counts, I did not receive the same result using 1) the exact same statement from above and, 2) after making multiple changes to the same custom date field as in the first scenario.

 

What am I missing, other than the obvious, one field is numeric while the other is text - expected statement to work regardless of text vs number custom field?

Kalyan Sattaluri
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 13, 2024

Hard to tell.

  • If you have created a readonly text field.
  • First time should work.
  • Next time onwards, may have to convert the value to numeric first and then add.

To help,

  • Please share your screenshot of the rule.
  • Also log into your Jira so your browser has your credentials cached,
  • Next replace bolded parts in below URL with your domain and sample key
  • https://yourdomain.net/rest/api/2/issue/FNQD-1234?expand=names
  • Open new tab in your browser and put in URL and hit enter
  • In the response, search for your custom field name in question
  • and post the relevant response JSON section here

so we can help.

 

 

Daniel McCollum February 14, 2024

Jira automation looks like this...NOTE: field name blanked.

jiraautomationdatechangecount.png

 

Also, unable to set read-only text field to value, which may be part of issue for count not kicking off (IMO)...

jiraautomationdatechangecount2.png

Daniel McCollum February 14, 2024

@Kalyan Sattaluriapprecite your reply and described steps.

Screenshots were placed above, one of jira rule (pretty basic) and one of an attempt to edit read-only custom field in question.

I copied url provided, and executed by hitting enter using the updated api version 3 in addition to api 2 (from your original url posted):

Both resulted in the same data.

I was able to search and find my custom field from view on JSON tab in two places - one was custom field id and other down below on page result showed null value.

0 votes
Kalyan Sattaluri
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.
January 22, 2024

I know you mentioned not to use API, but above solution only works for go forward... if you want a complete solution, that is, accounts for changes already made.. you will have to use one.

At a high level -

Create a JQL for all issues you are interested in (for example, issuetype = Epic and status != Done) and set up a scheduled trigger, process all issues in bulk..

Then make a web request call to https://yourdomain.net/rest/api/2/issue/{{issue.key}}?expand=changelog

create a new variable (myvar)  and set its value to:

{{#webhookResponse.body.changelog.histories}}{{#items}}{{#if(equals(field,"Target end"))}} {{field}} {{/}}{{/}}{{/}}

Then the number of times it has changed will be {{myvar.split(",").size}}

Assign this to the custom field you want.

This step gets you caught up.

From Then on, you can do what the other posted suggested for go forward changes..

NOTE: I am  in DC edition so we get all entries of changelog, I have read somewhere that cloud does not return all entries, if so, you may be stuck with only evaluating go forward.

Daniel McCollum January 29, 2024

@Kalyan Sattaluri, thank you for your response - we are running Jira Cloud, and there are limitations getting all past entries.  Although, most interested in go-forward since we do have history of field changes actively being recorded outside tool via risk register.  Thanks again for your contribution to my question!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events