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

How to modify testrail users using testrail API


#1

We have many users who left company but still active in Testrail. I am looking for programmatic way to modify users as disabled. I can get list of almost 500 users who should get deactivated.

Can you please provide method which can be performed on DB for disabling users.


#2

Hi Vivek,

Thanks for your posting. TestRail’s API only has read-only support for users (get_users) and we would recommend changing the status in the UI on Administration > Users & Roles instead. You can quickly toggle the Active status on the overview page with the dropdown. Please don’t change anything directly in TestRail’s database as this would be unsupported and may result in an unusable database.

Cheers,
Tobias


#3

Thanks Tobias, I am running Testrail user audit and found that 562 users should be disabled. I am not willing to disable these many accounts through UI.

are you guys are planning to add_user functionality in Testrail API?


#4

Hi Vivek,

Thanks for your feedback. There are currently no immediate plans but we are happy to look into this and I agree that an add_user and/or update_user API would be great to have in this case. We would currently recommend deactivating the users in the UI and you can quickly change the Active status on the overview page per user.

Cheers,
Tobias


#5

Thanks Tobias, add_user and update_user functionality in API will help in performing the close integration between Testrail and other user authentication such as Crowd, LDAP or AD.


#6

Hi Vivek,

For TestRail Server, there’s already a different API/integration for external authentication services you can use and we offer ready to use scripts for LDAP and Active Directory:

http://docs.gurock.com/testrail-integration/auth-introduction

This integration can also auto-add TestRail users based on the LDAP/AD login and authentication (AUTH_CREATE_ACCOUNT option).

I hope this helps!

Cheers,
Tobias


#7

Understand the LDAP/AD integration, however we have an internal application in which users request access to TestRail (tied to AD). It would be great if we could add users via API to TestRail and a project without having the user login to have their account created, even in this scenario we have to go into TestRail to add them to a project/role etc. Are there any enhancements on your backlog for additional user maintenance functionality? If so is there an ETA?

Thank you.
John