New and Improved 3.13 Beta. Highlights: Shareable filters and dashboards and lots of other goodies. Any feedback can be raised as JIRA issues in the JIRA project.
Issue Details (XML | Word | Printable)

Key: JRA-4149
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Richard THIBAULT
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JIRA

Calculated fields

Created: 02/Aug/04 08:57 AM   Updated: 18/Nov/07 05:23 PM
Component/s: Issue Fields
Affects Version/s: 2.6.1 Enterprise
Fix Version/s: 3.0

Time Tracking:
Not Specified

Issue Links:
Part
 
Reference
 

Participants: Jeff Turner [Atlassian] and Richard THIBAULT
Since last comment: 3 years, 45 weeks, 6 days ago
Resolution Date: 11/Oct/04 08:05 PM
Labels:


 Description  « Hide
In our organisation, we need to store fields that are calculated using the content of other fields. For instance, we need to create a date field which value is 2 days after the creation date.
Depending on the issue type and the project, the calculation rule is not the same: for bugs, it's "creation date + 2 days", but for enhancement it's "creation date + 5 days". It's something that should be automatic, because we cannot easily know what is the rule.
We need also to calculate integer fields or String fields based on values of other fields of the current issue.

In fact, the more flexible implementation of this should be to deliver the capability to define a Java class to define the default value of a field.
In this Java class, we should be able to use an API to access to the value of every other fields of the issue that is being submitted.
We should be able to associate a calculation class to a field at the field layout scheme level.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jeff Turner [Atlassian] added a comment - 02/Aug/04 05:59 PM
Sounds interesting. What sort of use-case would there be for derived fields?

Richard THIBAULT added a comment - 03/Aug/04 07:17 AM
What do you mean by "deriev fields" ?

Richard THIBAULT added a comment - 03/Aug/04 07:25 AM
another example :

We have a field named "request size" that is :

  • Minor if the estimation <= 5
  • Medium if the 5 < estimation < 20
  • Major if the estimation >= 20
    This field should automatically completed depending on the value of "initial estimation" field.
    The "request size" rule is also changing depending on the project priority of the issue.

Richard THIBAULT added a comment - 03/Aug/04 07:26 AM
You should have read :
The "request size" rule is also changing depending on the project.

Richard THIBAULT added a comment - 03/Aug/04 07:30 AM
I have also 2 other examples :
  • We would like to add a "last commenter" field. This field should be calculated by the Java calculation class by looking at the comment history.
  • We would like to add a "remaining time" field. This field should be also calculated by the Java calculation class by looking at the comment "due date" field and the today's date.

This calculation Java class must then be called at each time the value of the caculated field is requested by JIRA.

Is it more clear ?


Richard THIBAULT added a comment - 03/Aug/04 07:39 AM
About an easy way to use it, The JIRA administration interface should use introspection to detect compatible classes in a package defined by the administrator (the package name should be defined in the General Configuration Tab).
Then the administrator should choose a class in the list of compatible classes and associate it to a compatible field in a field layout scheme.

Jeff Turner [Atlassian] added a comment - 11/Oct/04 08:05 PM
This sort of thing is now possible by creating new custom fields:

http://confluence.atlassian.com/display/JIRA/A+Tutorial+for+Customizing+Custom+Field+Types

If there is a field type you think would be generally useful, please raise a new issue detailing how that field will work, and we'll see about implementing it.