It's all about the answers!

Ask a question

How to set a default Access Group using script based default in Attribute customization?


Kishore Nagareddy (3028) | asked Jan 20 '16, 3:06 p.m.
I'm trying to use the 'Restricted Access' attribute to be able to restrict work item access to some external contractors working on our project.
I would like set a default Access Group for this attribute so that the majority of the project members will not have set this value every time a new work item is created.
Is there a way to set this default using the script based default in Attribute customization?

Accepted answer


permanent link
Ralph Schoon (63.7k33648) | answered Jan 21 '16, 1:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You have to print the value of the restricted access attribute for a work item that has it set to the default and use that value - it is an ID - to set the default in a JavaScript provider.

Please note, if a user creates a work item, you set the default, and the user has no read access in that group, the user will have to change the value, if he wants to save the work item.
Kishore Nagareddy selected this answer as the correct answer

Comments
Kishore Nagareddy commented Jan 21 '16, 4:28 p.m.

 Thanks Ralph. I was able to find the UUID for the access group. How do I set this as the default in the JavaScript provider? Sorry, this is my first. 


Kishore Nagareddy commented Jan 21 '16, 4:54 p.m.

 I was able to figure it out. Thanks. 


Here is what my script looks like:
dojo.provide("com.example.common.AccessGroup");

(function() {
dojo.declare("com.example.common.AccessGroup", null, {

    getDefaultValue: function(attributeId, workItem, configuration) {

        var accessGroupUUID = "_klJ4EL4fEeWQC-B56NNQvg";
        return accessGroupUUID;
    }
});
})();


Ralph Schoon commented Jan 22 '16, 2:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.