Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to calculate average age of work items with respect to field against attribute in IBM RPE?

 Hi,

Can anyone please help in finding out the script or any other possible ways to calculate average age of the work items based on filed against attribute through RPE.




0 votes


Accepted answer

Permanent link

You can first store unique category values (workitem/workItem/category/name) in an array. Then iterate over each array element (using an Iteration element in RPE template). Within Iteration element, use a filter to get workitems filtered by category/name, get the indidual age using following Script Expression:

var today = new Date();
var createdYear = creationDate.toString().substr(0,4);
var createdMonth = creationDate.toString().substr(5,2)-1;
var createdDate = creationDate.toString().substr(8,2);
var created = new Date(createdYear, createdMonth, createdDate);
var created = new Date(creationDate.toString());
_age = age1 + Math.round((today - created)/(1000606024));
_count = _count*1 + 1;

_age/_count will give the average age.

meghana kaddu selected this answer as the correct answer

1 vote

Comments

Hi Subramanya,


Thank you for the response, Can you please attach any reference dta file ? That will be a great help.

Thanks and Regards,
Meghana 

Here is the sample template you can refer to.


2 other answers

Permanent link

Publishing (formerly RPE) is used mainly for documentation purpose and it depends on application data. If application does not provide such value, there are some techniques that you might want to try:


1) Java scripting
2) Create hybrid document using JRS data within PUB. If you can create JRS report with calculation you are looking  for, you can use JRS export to PUB option to get necessary PUB template details.

Hope this helps.

0 votes


Permanent link

 Hi Fariz,


Thank you for the reply, I checked the possibilities through JRS. It is not possible so I am checking the way to do in rpe, whether it is possible to calculate average age of work item with respect to an attribute value in Rpe?

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019

Question asked: Nov 01 '20, 1:20 a.m.

Question was seen: 1,669 times

Last updated: Nov 11 '20, 7:48 p.m.

Confirmation Cancel Confirm