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

[UI Script] How to display field's value of 'Add Result' window in 'Push Defect' window?

Hi,
I would like to take the value of ‘Version’ field and some other custom fields from ‘Add Result’ window and display them in ‘Push Defect’ window in ‘Environment’ field (once user presses the “Push” link in ‘Add Result’ window).
How can I implement it in a script?

Hi,

I was in the same situation couple of years ago. And you could take these guidelines if you are using Jira for your defect management tool.

Here’s how I got to “push” other field values to Jira when clicking the Push hyperlink in TestRail if the test scenario execution failed…

  1. Click the ADMINISTRATION link of top of TestRail page
  2. Scroll down and click the Integration > Manage integration link
  3. In the next page, there is a window that says "Please configure your JIRA connection below
  4. Under the [push.field] section, add the fields you need to push by typing the exact fieldname and set it to “on”. As an example I have these entries:

summary=on
project=on
issuetype=on
component=off
assignee=on
priority=on
affects_version=off
fix_version=off
estimate=off
labels=off
environment=off
parent=off
linktype=off
links=off
description=on
[push.field.priority]
remember=true
[push.field.project]
remember=true

I hope this helps.

Thanks for your answer.
But my question is more about the UI script and not regarding the template.
Let me clarify my question- as a first step, I need to identify the Add Result dialog, for that I have used the following script (taken from some old example i saw in the forum), but it does not work.
I would appreciate any help:

name: Demonstrate loaded event on result dialog
description: Demonstrate the loaded event on the Add Result dialog
author: Gurock Software
version: 1.0
includes: ^(runs|tests)/view
excludes:

js:
(document).ready( function() { .subscribe(‘result_dialog.loaded’, ‘uiscript_test_load’, function(o)
{
alert(‘loaded!’);
});
}
);

I confirm, the same code for ui script doesn’t work on my project (cloud tesrail).