We have configured a transition Namely "Detail Analysis Completed". In this Transition there is 2 fields -
1) Global in nature? [ Field Value = 11425 ]
2) Target Project Name(s) [ Field value = 11426 ]
In "Global in nature?" field there is 2 values -
1) Y [ valueid = 11588 ]
2) N [ Value ID = 11589 ]
Now we Need to set "Target Project Name(s)" field as mandatory when "Global in nature?" field value is "Y". Please note both "Global in nature?" and "Target Project Name(s)" are in same transition screen. Do we need to set any post function/condition/validator for that? If yes, then could you please provide us steps ?
Thanks in advance
Sumit Mitra
There may be other ways to do this, but one way is using a validator. Specifically, Conditioned validator that will return to the user if the condition is not met for them to do whatever is needed to allow the transition to proceed, like updating issue fields either from the transition screen or elsewhere. You use Substitution variables to retrieve the transition variables (in your case) to condition and also to construct a nice error message for the user.
I am not understand how can we implement this. Previously we have succuessfully impleamented "Show a particular customfield based on another customfield value" by configuring customised plugin using js script. Please find the js script below for previous case -
jQuery(document).ready(function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) { callChangeFunction(); }); callChangeFunction(); function callChangeFunction(){ showHidField(); // dropdown custom field change function $("#customfield_10020").change(function() { showHidField(); }); } function showHidField(){ //drop down field selected value var dropDownFieldval = $.trim($("#customfield_10020 :selected").text()); //test field1 $("#customfield_10221").closest('div.field-group').hide(); if(dropDownFieldval == 'New Machine Required'){ $("#customfield_10221").closest('div.field-group').show(); } } });
Can we using same procedure for "set a customfield required based on another customfield value" ? If so then could you please provide us the steps?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
we had a same requirement so we developed our own validator using jira api, you may also develop your own validator!!
same questions are posted here
https://answers.atlassian.com/questions/70973/how-do-i-make-a-field-required-based-upon-the-value-of-another-field-set-in-workflow-transition-screen
https://answers.atlassian.com/questions/146940/make-a-custom-field-required-based-on-another-custom-field
check this plugin also
https://jamieechlin.atlassian.net/wiki/display/JBHV/JIRA+Behaviours+Plugin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have using below mentioned script in Behavior Plugin but not working -
FormField pro = getFieldById("customfield_11425") FormField ecp = getFieldById("customfield_11426") String vpro = (String) pro.getFormValue() String vecp = (String) ecp.getFormValue() //to see values near fields uncomment sentences // pro.setHelpText("vpro: "+ vpro) //ecp.setHelpText("vecp: "+ vecp ) if (vpro == "Y") { ecp.setRequired(true) }else{ ecp.setRequired(false) }
Could you please look into this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.