Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • Is it possible to View field on create screen based on values selected in another custom field.

Is it possible to View field on create screen based on values selected in another custom field.

Akshaykumar
October 5, 2018

I have two fields on create screen PPM# and Summary Task#. So the configuration should be as follows.

  • When user fills value for PPM# and Summary Task #
    • Show the Project Name and Project Description fields.
    • Make both required.
  • When user DOES NOT fill value for PPM# and Summary Task #
    • Hide the Project Name and Project Description fields.
    • Make both optional.
  • When the user fills PPM# but DOES NOT fill Summary Task #
    • Show the Project Name and Project Description fields.
    • Make both required.

1 answer

1 accepted

0 votes
Answer accepted
Alexey Matveev
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 Champions.
October 5, 2018

Hello,

You would need an add-on for it.

For example, you can use the Power Scripts add-on:

https://marketplace.atlassian.com/apps/43318/power-scripts-jira-script-automation?hosting=cloud&tab=overview

You could write a Live Field to follow your logic. You can read more about Live Fields here:

https://confluence.cprime.io/display/JJUPIN/Live+Fields

You can find an example on how to work with Live Fields here:

https://confluence.cprime.io/display/TR/Field+Manipulation

Akshaykumar
October 8, 2018

Hi Alexey,

Thanks for quick response.

I configured this through Script Runner plugin.

import com.onresolve.jira.groovy.user.FormField
FormField ppmField = getFieldById("customfield_10100")
FormField summaryTask = getFieldById("customfield_10101")
FormField projectName = getFieldById("customfield_10019")
FormField projectDescription = getFieldById("customfield_10018")
if(ppmField.getValue() > "0" && summaryTask.getValue() > "0")
{
projectName.setHidden(false)
projectDescription.setHidden(false)
projectName.setRequired(true)
projectDescription.setRequired(true)
}
else if (ppmField.getValue() > "0")
{
projectName.setHidden(false)
projectDescription.setHidden(false)
projectName.setRequired(true)
projectDescription.setRequired(true)
}
else
{
projectName.setHidden(true)
projectDescription.setHidden(true)
projectName.setRequired(false)
projectDescription.setRequired(false)
}

 

Akshaykumar
October 8, 2018

Hi Alexey,

Thanks for quick response.

I configured that through Script runner plugin in Behaviours.

import com.onresolve.jira.groovy.user.FormField
FormField ppmField = getFieldById("customfield_10100")
FormField summaryTask = getFieldById("customfield_10101")
FormField projectName = getFieldById("customfield_10019")
FormField projectDescription = getFieldById("customfield_10018")
if(ppmField.getValue() > "0" && summaryTask.getValue() > "0")
{
projectName.setHidden(false)
projectDescription.setHidden(false)
projectName.setRequired(true)
projectDescription.setRequired(true)
}
else if (ppmField.getValue() > "0")
{
projectName.setHidden(false)
projectDescription.setHidden(false)
projectName.setRequired(true)
projectDescription.setRequired(true)
}
else
{
projectName.setHidden(true)
projectDescription.setHidden(true)
projectName.setRequired(false)
projectDescription.setRequired(false)
}
Like Marcus O_Brien likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events