It's all about the answers!

Ask a question

How to get Modified Date attribute of a work Item


Kruttika Pendharkar (21174) | asked Dec 01 '11, 2:18 a.m.
Hi,

How can we get Modified Date of any workitem with respect to state change (From New to In- progress etc.)??
there is a predefined method to get Due Date.
How to get Modified Date?

Thanks,
Kruttika

11 answers



permanent link
VK L (8177154159) | answered May 30 '12, 6:22 a.m.
Hi Karthik,
try this code for the date part:

var ModifiedDate = dojo.date.stamp.fromISOString(workItem.getValue(com.ibm.team.workitem.api.common.WorkItemAttributes.MODIFIED));
var date= dojo.date.stamp.toISOString(ModifiedDate, {milliseconds:true, zulu:true});
console.log("Now is: " + date);

and return the date based on the if condition.

Thanks.

permanent link
Muthukumar C (32712833) | answered May 30 '12, 1:26 a.m.
Hi,

I am not sure about the JS syntax. In java we have to use java.sql.TimeStamp data type.

Hi,

I have fetched the modified date using script but i'm not able to set that value to another custom attribute of type Timestamp. Its not throwing any error in log file also.
Since the modified date and my custom attribute is of same type, I'm fetching the modified value and passing to custom attribute but I'm not able to see the value in custom attribute. Do we have to convert the modified date value and return it as a timestamp or string??
could anyone share your thoughts on this....

Below is the code i'm using

// JavaScript Document


dojo.provide("com.example.dateCalculationValueProvider");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.date.stamp");

(function() {

var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

dojo.declare("com.example.dateCalculationValueProvider", null, {

getValue: function(attribute, workItem, configuration) {

//Get Status value
var Status = workItem.getValue(com.ibm.team.workitem.api.common.WorkItemAttributes.STATE);
console.log("State value is "+Status);

var ModifiedDate = dojo.date.stamp.fromISOString(workItem.getValue(com.ibm.team.workitem.api.common.WorkItemAttributes.MODIFIED));
console.log("Modified Date is " +ModifiedDate);

if ((Status = "com.ibm.team.apt.storyWorkflow.state.s15")) {//literal value for "Ready to Implement" from process source config..

var result = ModifiedDate;
return result
}
}
});
})();


Hi Krutika

Do you have a solution for this? Were you able to get the modified date on a state change? If yes please share.

Thanks in advance.

Hi,

How can we get Modified Date of any workitem with respect to state change (From New to In- progress etc.)??
there is a predefined method to get Due Date.
How to get Modified Date?

Thanks,
Kruttika

		                                        

permanent link
Karthikeyan Elangovan (3644) | answered May 29 '12, 10:27 a.m.
Hi,

I have fetched the modified date using script but i'm not able to set that value to another custom attribute of type Timestamp. Its not throwing any error in log file also.
Since the modified date and my custom attribute is of same type, I'm fetching the modified value and passing to custom attribute but I'm not able to see the value in custom attribute. Do we have to convert the modified date value and return it as a timestamp or string??
could anyone share your thoughts on this....

Below is the code i'm using

// JavaScript Document


dojo.provide("com.example.dateCalculationValueProvider");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.date.stamp");

(function() {

var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

dojo.declare("com.example.dateCalculationValueProvider", null, {

getValue: function(attribute, workItem, configuration) {

//Get Status value
var Status = workItem.getValue(com.ibm.team.workitem.api.common.WorkItemAttributes.STATE);
console.log("State value is "+Status);

var ModifiedDate = dojo.date.stamp.fromISOString(workItem.getValue(com.ibm.team.workitem.api.common.WorkItemAttributes.MODIFIED));
console.log("Modified Date is " +ModifiedDate);

if ((Status = "com.ibm.team.apt.storyWorkflow.state.s15")) {//literal value for "Ready to Implement" from process source config..

var result = ModifiedDate;
return result
}
}
});
})();


Hi Krutika

Do you have a solution for this? Were you able to get the modified date on a state change? If yes please share.

Thanks in advance.

Hi,

How can we get Modified Date of any workitem with respect to state change (From New to In- progress etc.)??
there is a predefined method to get Due Date.
How to get Modified Date?

Thanks,
Kruttika

		                                        

permanent link
Ralph Schoon (63.1k33645) | answered May 29 '12, 6:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I would also recommend

https://jazz.net/library/article/784

and especially

https://jazz.net/library/article/634

permanent link
Muthukumar C (32712833) | answered May 29 '12, 5:55 a.m.
Hi Gayathri,

Plug-in is nothing but the JAVA version of what you are doing in the JS.

Go through this link and understand the concept behind it.

https://www.ibm.com/developerworks/mydeveloperworks/blogs/extendingrtc/entry/checksummaryadvisor?lang=en_us

following the same method, we can update and modify any fields

Regards
Muthukumar.C

Hi Muthukumar

Yes I am trying to implement the same. I have a new field attribute created and i have placed an attribute customization script in this field. the script is trying to get the modified date timestamp in which the state of 'Review' Work Item type is changed from New to Ready For Review. But I am not getting any value in the attribute field as expected.

Can you please explain on how to make this work? What is Operation Advsior plugin?

Thanks
Gayathri



Hi,

We can achieve this by adding a new field in project and create Operation Advsior plugin using plain JAVA which will capture the Current date Time and save it to this Last Modified field...

You can update this field on every save or you can update this field only on status change.



Hi,

How can we get Modified Date of any workitem with respect to state change (From New to In- progress etc.)??
there is a predefined method to get Due Date.
How to get Modified Date?

Thanks,
Kruttika

permanent link
Gayathri Vikraman (661129) | answered May 29 '12, 5:34 a.m.
Hi Muthukumar

Yes I am trying to implement the same. I have a new field attribute created and i have placed an attribute customization script in this field. the script is trying to get the modified date timestamp in which the state of 'Review' Work Item type is changed from New to Ready For Review. But I am not getting any value in the attribute field as expected.

Can you please explain on how to make this work? What is Operation Advsior plugin?

Thanks
Gayathri



Hi,

We can achieve this by adding a new field in project and create Operation Advsior plugin using plain JAVA which will capture the Current date Time and save it to this Last Modified field...

You can update this field on every save or you can update this field only on status change.



Hi,

How can we get Modified Date of any workitem with respect to state change (From New to In- progress etc.)??
there is a predefined method to get Due Date.
How to get Modified Date?

Thanks,
Kruttika

permanent link
Ralph Schoon (63.1k33645) | answered May 29 '12, 5:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,

We can achieve this by adding a new field in project and create Operation Advsior plugin using plain JAVA which will capture the Current date Time and save it to this Last Modified field...

You can update this field on every save or you can update this field only on status change.


Nice idea, thanks for sharing.

permanent link
Muthukumar C (32712833) | answered May 29 '12, 5:26 a.m.
Hi,

We can achieve this by adding a new field in project and create Operation Advsior plugin using plain JAVA which will capture the Current date Time and save it to this Last Modified field...

You can update this field on every save or you can update this field only on status change.



Hi,

How can we get Modified Date of any workitem with respect to state change (From New to In- progress etc.)??
there is a predefined method to get Due Date.
How to get Modified Date?

Thanks,
Kruttika

permanent link
Ralph Schoon (63.1k33645) | answered May 29 '12, 4:43 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,

How can we get Modified Date of any workitem with respect to state change (From New to In- progress etc.)??
there is a predefined method to get Due Date.
How to get Modified Date?

Thanks,
Kruttika


As far as I am aware the work item only tracks the last modification accessible with the modified() method. If you want specifics on when a state changed etc, you would either have to get the history and analyze it, or you would have to try to go through the state history and analyze it. I haven't tried that myself, so I am not sure how to approach it.

permanent link
Gayathri Vikraman (661129) | answered May 29 '12, 4:13 a.m.
Hi Krutika

Do you have a solution for this? Were you able to get the modified date on a state change? If yes please share.

Thanks in advance.

Hi,

How can we get Modified Date of any workitem with respect to state change (From New to In- progress etc.)??
there is a predefined method to get Due Date.
How to get Modified Date?

Thanks,
Kruttika

Your answer


Register or 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.