RegisterLog In to Jazz.net dW

It's all about the answers!

Ask a question

Scripting to set owned by attribute


Terry Kemp (353) | asked Jun 15 '12, 1:56 p.m.
retagged Jun 16 '12, 12:08 p.m. by Evan Hughes (1.6k17)
I am trying to write a script that sets the owned by attribute for work items.  From looking at resources online, I understand that you have to get the GUID for the members and use this string to set the owned by attribute.  Using the examples online I have gotten it to work when the GUID is a parameter in the Process Configuration Source XML.

So for example, this code works:

dojo.provide("org.example.SetECMOwner");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

var SetECMOwner= dojo.declare("org.example.SetECMOwner", null, {

    getValue: function(attributeId, workItem, configuration) {
        return configuration.getChild("parameters").getStringDefault("owner", "");
    }
});
})();

However, I can't get the logic to work when the GUID is a variable in the script itself.  Looking for hints on how to possible make this work.  Here is what does not work:

dojo.provide("org.example.SetECMOwner");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

var SetECMOwner= dojo.declare("org.example.SetECMOwner", null, {
    var userID = new String("_lKtTgCuwEeGpYa9eAF1pPA");
    return userID;
    }
});
})();

One answer



link
Michael Walker (93762743) | answered Jun 18 '12, 1:42 a.m.
Not sure if you've already seen this page or if it helps:

https://jazz.net/wiki/bin/view/Main/AttributeCustomizationExamples

Your answer


Register or log in to post your answer.