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.
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
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:
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.
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]"])
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events