I am trying to find a way to create a custom field that will default based on the component the user chooses in the Create Issue screen. We use components as our system/applications. We want to be able to choose a system/application and have the custom field default with the correct person that is over that system/application.
Any ideas?
Community moderators have prevented the ability to post new answers.
Hello Brock,
please take a look here https://marketplace.atlassian.com/plugins/com.onresolve.jira.plugin.Behaviours
This is a powerful plugin that allows you to implement this feature.
Hope this helps,
Fabio
Thanks Fabio. I've downloaded the plugin, but I'm having an issue. I'm not a developer so I don't know how to write scripts. I saw some of the sample ones here https://jamieechlin.atlassian.net/wiki/display/JBHV/JIRA%20Behaviours%20Plugin#JIRABehavioursPlugin-Setonefieldbasedonanotherfieldwithinformationprovidedbytheserver
but I couldn't seem to find what I was looking for.
What I want to be able to do is select a component and have my custom field populate with component lead. I created a user picker custom field named, "Component Lead". Now I need help adding a script to the behaviour that will populate the Component Lead field with right user based off the component selelcted.
Can you help with that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
I tried this myself and it didn't work. I didn't see anything in the logs either. Did you ever get this working yourself?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, here it is step by step:
FormField formComponent = getFieldById(fieldChanged) FormField formUserField = getFieldByName("Component Owner") String componentLead components = formComponent.getValue() as List // if any components have been set, set the user field to the component lead of the first component // otherwise unset it if (components) { formUserField.setFormValue(components.first().lead) } else { formUserField.setFormValue("") }
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.