The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to set custom condition in a webitem jira plugin

Deepali Bagul
Contributor
March 14, 2018

Hi All,

I am new to developing the jira plugins. I want to set a custom condition on a webitem which points to a link. The button is visible on issue view page.

I want the button should be only visible on projects that belongs to specific category. Below is the code for condition

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.Project

Project project = jiraHelper.getProjectObject()
def projectCategoryForProject = ComponentAccessor.getProjectManager().getProjectCategoryForProject(project)?.getName()
projectCategoryForProject in ["HyperWorks"]

But I do not know how and where to set this condition in atlassian-plugin.xml

Also please guide how to create condition class and where it resides.

please guide. Thanks in advance!

 

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.