I'm implementing a help desk in JIRA where I have two drop downs - both 'single value select' forCategory and Sub-category.
For example, I have following Categories:
And each category has a list of sub-categories within them. For example, Design will have following list of options
By default, ONLY Category dropdown should be displayed on the CREATE ISSUE screen. When user selects one of the categories, corresponding sub-category drop-down should be displayed on the CREATE ISSUE screen AND that sub-category dropdown should be MANDATORY field.
I looked up for possible solution at the following links:
However, I do not get any alert on the CREATE ISSUE screen. So, not sure if I am missing anything here. Please advise if I'm looking in the right direction.
The 3rd link, suggests to create a plugin from the JIRA machine. However, I do not have access to that machine, I just have admin access to JIRA.
Is there any feasible way to achieve it via default JIRA configurations/external plugins which are ready-to-use?
My JIRA version is: 6.1.4
just put the following code on announcement banner for testing
no need machine permission to deploy plugin, if you have admin access you can update plugin through JIRA Admin UI, following doc explains how to upload addon
Thank you Prasad. This approach might work I believe and I might go in the right direction now.
However, the JIRA.Events.NEW_CONTENT_ADDED does not fire if I change the dropdown options. I have to either click CREATE or do some other 'server' event to fire it.
Also, this approach might not work to 'show' the element. As the java script would be able to show/hide only those controls which are already rendered on the page. I'm also looking for a way to have the fields available on CREATE ISSUE screen, but only visible via my custom logic.
check the answer i posted on following link in your question https://answers.atlassian.com/questions/217176/show-hide-custom-field-depend-on-another-custom-field-value it will fire all the events you no need click on create button! the field should be there on the create screen then only we can hide/show that field, you can add field to create screen, check the following docs https://confluence.atlassian.com/display/JIRA/Defining+a+Screen https://confluence.atlassian.com/display/JIRA/Configuring+Fields+and+Screens
Thank you Prasad. Your solution worked for the Show-Hide logic.
I looked for the solutions to make those sub-categories fields Mandatory and learnt that I could use JIRA Behavior Plugin. I actually used that and put the following script:
FormField category = getFieldById("customfield_11480"); String categoryVal = category.getValue(); FormField contentDev = getFieldById("'customfield_11481"); contentDev.setRequired(categoryVal == "Content Development"); FormField events = getFieldById("'customfield_11482"); events.setRequired(categoryVal == "Events"); FormField design = getFieldById("'customfield_11483"); design.setRequired(categoryVal == "Design"); FormField web = getFieldById("'customfield_11484"); web.setRequired(categoryVal == "Web");
The fields do get a '*' sign so they are set to Mandatory. However, whenever I try to CREATE the issue, I get 'Please wait a moment for the server to finish then retry your action' error pop-up. It looks like an existing issue with JIRA - JBHV-154.
NOTE: I've tried code with and without semicolon and still get the issue;
Can you please suggest anything here? If not Behaviour plugin, is there any other way to make the fields mandatory?
Rumit, sorry, i don't have any idea on Behavior plugin, other options are 1. you can develop your own validator using jira api, check following doc to know how to develop validator http://www.j-tricks.com/tutorials/workflow-validator 2. using java script you can do front end validation!
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG