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

[TestRail API] New Project Access


#1

Hi everyone,

We are currently doing a tool that copies a project with a new name. At the moment, the overall default access is set to “No Access”. However, when creating a new project using the TestRail API add_project, the Default Access of this new project is “Global Role” which we want to avoid.

Here’s my C# snippet:

        JObject oldProject = (JObject)Client.SendGet("get_project/" + currentProject["id"].ToString());

        data = new Dictionary<string, object>
        {
            {"name", Zt_NewName.Text},
            {"announcement", oldProject["announcement"]},
            {"show_announcement", oldProject["show_announcement"]},
            {"suite_mode", oldProject["suite_mode"]}
        };
        JObject newProject = (JObject)Client.SendPost("add_project", data);

Is there a way to create a new project with “No Access” as default… or to copy the same permission of the Project that we want to copy?!

Your help is really appreciated!

Thanks and Cheers,

-Steve


#2

Hi Steve,

Thanks for your posting and we are happy to help with your questions! The permissions are currently not supported via the API and TestRail would always create new projects with the “Global Role” default access (and an empty list of user & group overrides). You can still copy the project via the API of course, but you would currently need to set the permissions manually in TestRail.

Regards,
Tobias


#3

Hi ,

Would it be possible to have an API for access rights in Projects as mentioned by Steve? We are creating new projects everyday, automatically and it is very tidious to do the access update for each new projects manually.

Since Testrail has several APIs, would it be great to have the things done manually be automated too? I always find the tool flexible and an additional API would add up to this + points.

Hoping for this request to be granted.
Thank you.