Hide development tool in specific project with specific custom field

Zachi Meyer December 30, 2020

Hi everyone,

I'm using "Hide System or plugin UI element" plugin and I want that the "create branch" in the development tool will be hidden in these conditions:

  • Project = "Test" with Issue Type = "Bug" with the custom field named "Currently Live in" (customfield_15044)  = "Staging"

 

How to I write it in the "Hide UI element" plugin?

 

 

1 answer

0 votes
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 31, 2020

Hi @Zachi Meyer ,

just to be clear - you are using this functionality? Would you please provide us information, why do you want to do such a thing? Your users will be able to create branch from elsewhere, so it seems to me it won't help much just hide it in the issue view.

Zachi Meyer December 31, 2020

Hi @Hana Kučerová  , 

 

I'm using the functionality you mentioned.

I want to avoid from developers to put code on JIRA with the custom field "Currently Live in" with the value "Staging".

I want to do this on specific project and not all the projects.

 

Thanks.

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 1, 2021

Hi @Zachi Meyer ,

thank you. So you don't want developers to be able to commit and push code, when your custom field has specific value? I don't think this is possible. Even if you hide development panel from the issue view, they will still be able to work with the code.

Zachi Meyer January 3, 2021

Hi @Hana Kučerová ,

I only want to hide the development section with "bug type" and custom field with specific value.

I did it for specific statuses and it worked.

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 3, 2021

Hi @Zachi Meyer ,

if your custom field has "Select List (single choice)" type, you can try something like this:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.customfields.option.Option
import com.atlassian.jira.issue.fields.CustomField

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField customField = customFieldManager.getCustomFieldObject("customfield_15044")
Option customFieldOption = issue.getCustomFieldValue(customField) as Option

!(issue.projectObject?.key == "TEST" && issue.issueType?.name == "Bug" && customFieldOption?.getValue() == "Staging")

Zachi Meyer January 3, 2021

OK I'll try it,

 

Thanks

Suggest an answer

Log in or Sign up to answer