Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

UI script to manage default group settings for a new project


#1

We go through a lot of projects, several are created per week. I am looking for a way to assign default values to certain aspects of the Access tab on the new project page. Specifically: I have 2 groups that should have the same values on every project.

group-3 (the ID for the group) Needs to be set to (I assume) -2 for No Access, and group-5 Needs to be set to -1 (For Gloal Role)

I found this snippet elsewhere for the default access:

js:
$(document).ready(
    function() {
        $('#access').val(-2);
    }
);

Which works, but I have had no luck with any of the following:

$('#group-3').val(-2);
$('#groupaccess-3').val(-2);

One of which I think is the area I need to change.


#2

Try this testrail magic:

App.Dropdowns.setTag("#groupAccessDropdown", 3); //select group with ID 3
App.Admin.setGroupAccess(-2); //set no access for selected group


#3

Thank you, that worked perfectly.