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

Scripting to set owned by attribute

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;
    }
});
})();

0 votes



One answer

Permanent link
Not sure if you've already seen this page or if it helps:

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

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
× 10,953
× 369

Question asked: Jun 15 '12, 1:56 p.m.

Question was seen: 6,077 times

Last updated: Jun 18 '12, 1:42 a.m.

Confirmation Cancel Confirm