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

Hide attachments area of Add Result window?

We use TestRail with Jira for end user acceptance testing, so any attachments to results need to be included in the results that are Pushed to Jira. I know users can attach once they are in the Push dialog, but some seem prone to forgetting that they should do this.

Is it possible to hide the attachments area on the results window?

I had a look around and I see there is an option to use UI scripts to customise the appearance of some areas, so I am hoping I can use this option. Is there somewhere I can look up how to do this?

Thanks in advance

Hi,
check this post:


It is handlign a different field and you probably have to apply some UI changes, but the idea should be clear…

Hopefully. :grinning:

1 Like

Thanks for the starting point, I have made some progress and I have it working in our sandbox project with this function:

$(document).ready(
    function() {
        if (!uiscripts.context.project || uiscripts.context.project.id === 1) // only affects Sandbox project 
        {
            $.subscribe('result_dialog.loaded', 'uiscript_hide_version', function() {
                $('#result_content').hide(); // hides div containing attachment dropzone 
            });
        }
    }
);

The result looks like this

I would like to make one tweak to improve the appearance of the results. Is it possible to also have the comment box expanded to 12 lines instead of the 6 it is set to by default?

Here is what I have tried, but it is not having the desired effect.

$(document).ready(
    function() {
        if (!uiscripts.context.project || uiscripts.context.project.id === 1) // only affects Sandbox project 
        {
            $.subscribe('result_dialog.loaded', 'uiscript_expand_comments', function() {
                $('#result_content').hide(); // hides div containing attachment dropzone 
                $('#addResultComment').rows = 12; // attempting to expand the Comment text area 

            });
        }
    });

I’m sure I have missed something small. Hopefully someone is more familiar with this and can offer guidance?

Thanks