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

Using custom fields in AuthResultSuccess


#1

Hi guys,

we are using the push defect plugin for trac. We would like to be able to use custom fields in the AuthResultSuccess. For example, we would like to use the LDAP login name as the trac reporter value when we push a new defect instead of the stripped email value.

Ex. email = test.louis@test.com
Ex. login = louist

push would use “louist” instead of “test.louis” as the reporter.

Hope you can help us,

Thanks,
Louis


#2

Hello Louis,

Thanks for your posting. It’s currently not supported to re-use the authentication credentials for the Push Defect feature. TestRail only uses the LDAP credentials for authenticating user logins and does not store them.

That said, you can customize the Push Defect authentication by setting up a per-user authentication for the defect plugin. This looks as follows:

http://docs.gurock.com/testrail-integration/defects-plugins-variables

I hope this helps!

Regards,
Tobias


#3

Maybe I did not explain my use case properly.

In the authentication plugin, we do

$result = new AuthResultSuccess($mail);
$result->name = $display_name;
$result->create_account = AUTH_CREATE_ACCOUNT;
return $result;

Now, could we do:

$result->login = ...

and in the trac plugin, do:

$context['user']->login

Thanks in advance,
Louis


#4

Hello Louis,

Thanks for the additional details. This wouldn’t be supported currently but you can use the defect plugins to customize the defect plugin per user (e.g. use a different login). I would recommend reviewing the documentation on defect variables to learn more:

http://docs.gurock.com/testrail-integration/defects-plugins-variables

Regards,
Tobias


#5

Hi Tobias,

we were using two different type of logins (two different ldap). We would like to merge them and we could that on our own so we only have one in the end.

After, we would like to push the defect to JIRA instead of our old migrated trac instance. Since we are using corporate LDAP in JIRA and the same in Testrail, is there a way we do not store passwords/username in the user variables, but reusing them from either the “context” or some other way?

we were also looking at the possibility of using a single user for interfacing JIRA and then overriding the reporter name with the username that filled the push defect form since it will be the same user. But we might face issues with the JIRA authentication depending if the user has the right to override the reporter name at creation time, etc.

Any idea you may have are welcome.

Thanks!


#6

Hi Louis,

Thanks for your posting! TestRail doesn’t store the LDAP credentials from the login for later reuse and user variables are the recommended way to integrate with JIRA. We also plan to support additional ways of authenticating JIRA requests in the future. Overriding the reporter name is problematic as you’ve mentioned and the user variables would be preferred.

Have you already had the chance to take a look at the new JIRA integration features and add-ons (added with TestRail 5.0)? The new version adds a lot of integration options on the JIRA side and we are happy to help in case you have any questions.

https://blog.gurock.com/?p=3365

Cheers,
Tobias


#7

Thanks Tobias. I will try to use the user variables for now. On a side note, it may be interesting to explore the “authentication tokens” that could be used to interface JIRA, etc.

Regards


#8

Thanks, Louis! Yes, we will definitely make sure to review this for a future version.

Cheers,
Tobias