Question about the Calculated Date/time field

Tini Good
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.
March 19, 2014

I have JIRA Miscellaneous Custom Fields add-on installed, and I'm try to setup a custom field of type Calculated Date/Time.

I want to know the number of days between when an issue is resolved, and when it has completed independent verification. I already have a custom field called "VerifyEnd" (FieldID=11200) that automatically posts the current date on transition out of the Verification state.

It seems like this forumula should work, but I'm not having any luck. Suggestions?

<!-- @@Formula: org.apache.commons.lang.time.DateUtils.addDays(issue.get("resolution_date"),("FieldId=11200")) -->

4 answers

1 accepted

0 votes
Answer accepted
David _old account_
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.
March 19, 2014

First of all, I don't see what you mean by "("FieldId=11200")" in your formula.

Then, I believe you want a date difference, not to add two dates. There are several examples in other questions:

https://answers.atlassian.com/questions/250567/using-current-date-no-time-component-in-a-date-range-calcualtion

https://answers.atlassian.com/questions/250563/jira-misc-custom-fields-date-interval-calculation-ignoring-weekends

0 votes
Emre Toptancı _OBSS_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 26, 2019

For those interested in a ready to use solution without a custom field, Time in Status app by OBSS produces reports that show first/last status transition dates for each status. The app also includes reports that show how much time each issues spent in each status, assignee or group; number of times each status or transition was used.

No custom fields are used, all report calculation is based on existing issue histories so you can report on issues of the past.

All report data can be exported as XLS, XLSX or CSV.

0 votes
David _old account_
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.
March 20, 2014

I've never seen this syntax, and I'm positive it cannot be used in your context. Custom field names are in the form: "customfield_11200". So issue.get("customfield_11200") will return the value of that field.

Tini Good
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.
March 20, 2014

Yep, you are right, I mis-read some instructions. Thanks! I'll see if this clears up my problem.

0 votes
Tini Good
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.
March 20, 2014

Thanks. "("FieldId=11200")" is the FieldID of a custom field in my instance. I believe that is the correct syntax to have the formula recognize it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events