Hide Pull request in Jira for particular transaction

Gsep Support January 9, 2020

Hello,

 

We came across a scenario where we need to hide Pull request for specific status in Jira. Means Pull Request should visible only for specific status and for rest of the status pull request should not visible. I have checked with atlassian support according to them we can not restrict the pull request button from JIRA. Is it possible to do with script runner or something else.

 

Thank You,

Mrityunjay Biswas

3 answers

0 votes
Gsep Support February 17, 2020

Hello Guys,

Thanks for your valuable solution. Anyway i got the feasible solution for this. We can create a fragment and choose the com.atlassian.jira.plugins.jira-development-integration-plugin:devstatus.cta.createbranch option to hide the option for dev panel. Now we need to define for which project we want to hide it and for which and all status we dont want with below format.

return ! (jiraHelper.project?.key == "[Project Name]" && issue?.status?.name in ["[State1]","[State2]"]) 

 

Thank You,

Mrityunjay Biswas

0 votes
Leonard Chew
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2020

Hi Mrityunjay

I don't know what your "pull request" is exactly, but I gather it is a link provided by a feature of bitbucket server and a jira-plugin.

Per default you will probably not find an ootb solution with scriptrunner to hide it. There is however the possibility to inject css-code to your issue-screen and therefore you are able to hide anything on your issue-screen.

I have posted a css-inject solution to hide the "assign to me" button here:

https://community.atlassian.com/t5/Jira-questions/How-to-disable-Assign-to-me-functionality-for-a-few-specific/qaq-p/1240842

Using scriptrunner you could do the same for your pull-request link. You'll have to analyse the link by using F12 on your browser (to get its identifier, e.g. ID or class).
The solution might break with future releases however, as this is just a hack.

Hope this helps you.
Cheers Leonard

0 votes
Lenin Raj
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 11, 2020

Hi @Gsep Support

I am afraid there isn't a readymade script to achieve this. However I would recommend you to check this page from scriptrunner to customize the UI: https://scriptrunner.adaptavist.com/5.0.0/bitbucket/CustomisingUI.html

Suggest an answer

Log in or Sign up to answer