Forums

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

Hide user picker field if value of single select field is NO

Gnanabaskar
Contributor
January 29, 2024

Hi All,

We are looking for solution on the below scenario.

We have two custom fields 

  • IT Business approval needed ( Single Select & Value = Yes  & No )
  • Business approver ( User picker )

If we select IT Business approval needed field value as YES, then Business approver ( User picker ) should be enabled/shown. 

If we select IT Business approval needed field value as NO, then Business approver ( User picker ) should be Disabled/Hidden. 

 

Is there a way to achieve this in Jira Cloud? Kindly assist.

 

Thanks,

Pradeep 

4 answers

1 vote
Naveen Kumar_Appfire
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2024

Hi @Gnanabaskar

As far as I know, it is not possible using the default Jira.

It is possible to achieve the same using  Power Scripts - Jira Workflow Automation app.

For the data center, we have a live field feature to achieve this, and unfortunately, there are no live fields in the Cloud.

As a workaround, you can use Condition / Validators or Post functions.

  • If field 1 =yes, field 2 shouldn`t be empty. Or if field 1=No, field 2 must be empty
  •  if field 1 = NO, write some default value to field 2.
0 votes
Gnanabaskar
Contributor
January 29, 2024

Hi Naveen,

Is this code right?

When Business Lead Approval field is YES, BusinessApproverfield should hide

 

const BusinessLeadApprovalfield = getFieldById("customfield_10246");
const BusinessApproverfield = getFieldById("customfield_10247");

logger.info('Value :'+ BusinessLeadApprovalfield.getValue().value);

if(BusinessLeadApprovalfield.getValue().value=='Yes') {
    BusinessApproverfield.setVisible(true);
    logger.info('true');
}
else {
    BusinessApproverfield.setVisible(false);
    logger.info('false');

}
Gnanabaskar
Contributor
January 29, 2024

@Nic Brough -Adaptavist-  Hi Nic, can you please advice on the 

  • IT Business approval needed ( Single Select & Value = Yes  & No )
  • Business approver ( User picker )

 

const BusinessLeadApprovalfield = getFieldById("customfield_10246");
const BusinessApproverfield = getFieldById("customfield_10247");

 

logger.info('Value :'+ BusinessLeadApprovalfield.getValue().value);

 

if(BusinessLeadApprovalfield.getValue().value=='Yes') {
    BusinessApproverfield.setVisible(true);
    logger.info('true');
}
else {
    BusinessApproverfield.setVisible(false);
    logger.info('false');

 

}
0 votes
Pierre Ibrahim
Contributor
January 29, 2024

Hi @Gnanabaskar

This can not be achieved with no plugins, Scriptrunner would allow you to do this quiet easily:

Add a behavior on the custom field, you can set it to hidden and add a condition, at that point you'd be writing a couple of lines of Groovy code to check the value of the other field.

0 votes
John Funk
Community Champion
January 29, 2024

Hi @Gnanabaskar 

No, this is not possible with out-of-the box Jira. You might try ScriptRunner Behaviours app, but not not sure it is working with custom fields yet. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events