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

workItem.getValue(WorkItemAttributes.MODIFIED_BY) return nothing in web UI

Dears,

We need to populate a custom field, Contributor type, with the value of the attribute Modified by or with the logged in user. So we created the following script. The way the script works is in the eclipse client, but it does not work in the web interface. Could you please correct me on this script? and let us know the right script for my requirement. Thanks in advance

dojo.provide("br.com.bb.alm.mergeReq.ValidadoPor");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(function() {
dojo.declare("br.com.bb.alm.mergeReq.ValidadoPor", null, {
getValue: function(attribute, workItem, configuration) {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
//valor padrão;
var result = workItem.getValue("attr.mergeReq.validadoPor");
var status = workItem.getValue(WorkItemAttributes.STATE);
//verifica se o estado é "Aprovado para Entrega"
if(status === "br.com.bb.workitem.workflow.mergeReq.state.s4") {
result = workItem.getValue(WorkItemAttributes.MODIFIED_BY);
} else if(status === "br.com.bb.workitem.workflow.mergeReq.state.s1") {
result = null;
}
return result;
}
});
})();

1

0 votes

Comments

Have you done any debugging on the web client? Has the scripted been triggered? Is the variable "status" has the correct value? Does the code workItem.getValue() get called at all?

1 vote



One answer

Permanent link

 Hi I have the same issue 

WorkItemAttributes.MODIFIED_BY

is not giving any value during the modification of a work item, it gives null
I believe this should be corrected for consistency
 

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

Question asked: Jan 31 '18, 9:20 a.m.

Question was seen: 2,002 times

Last updated: Feb 12 '20, 5:58 p.m.

Confirmation Cancel Confirm