It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
Hi @Jamie Echlin [Adaptavist],
Can you help me with code where the field would be issue type and based on changes to issue type, i would like to make certain fields hidden or vsisible using Script Runner Behaviour plugin.
Writing Behaviour on a field Issue Type
import com.atlassian.jira.component.ComponentAccessor def issueTypeField = getFieldById(getFieldChanged()) def jpField = getFieldByName("JIRA Project") def urlField = getFieldByName("GitLab URL") def aurlField = getFieldByName("Additional URL's / Notes") def selectedOption = issueTypeField.getValue() as String if (selectedOption == "Story") { urlField.setHidden(false) urlField.setRequired(true) aurlField.setHidden(false) aurlField.setRequired(true) jpField.setHidden(false) jpField.setRequired(true) } else { urlField.setHidden(true) urlField.setRequired(false) aurlField.setHidden(true) aurlField.setRequired(false) jpField.setHidden(true) jpField.setRequired(false) }
What am i writing wrong in the code. please help me with this.
Regards
Chander Inguva
Hey @Thanos Batagiannis [Adaptavist],
That worked like magic.
I have created an Initialiser like below
def projectKey = getIssueContext().getProjectObject().getKey() def issueTypeName = getIssueContext().getIssueType().getName() def WSField = getFieldByName("Wiki Space Name") def SKField = getFieldByName("Space Key") def SAField = getFieldByName("Space Administrators") if (issueTypeName == "Wiki Space Request") { WSField.setHidden(false) WSField.setRequired(true) SKField.setHidden(false) SKField.setRequired(true) SAField.setHidden(false) SAField.setRequired(true) } else { WSField.setHidden(true) WSField.setRequired(false) SKField.setHidden(true) SKField.setRequired(false) SAField.setHidden(true) SAField.setRequired(false) }
Thank You
Chander Inguva
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreAtlas Camp is our developer event which will take place in Barcelona, Spain from the 6th -7th of September . This is a great opportunity to meet other developers and get n...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.