I have a custom field called "System" which lists all systems that may be impacted/relevant. Different issue types have different relevant systems (e.g. a "support issue" could be about basically any system, but a "data pull" would only come from one of a select few systems).
can i limit/alter the system options avialable based on the issue type or screen that the custom field exists on? this question sounds like it might be related to what i'm asking for (rerfers to custom field contexts, but i'm not sure if you can have multiple contexts based on issue type for the same project) https://answers.atlassian.com/questions/41092/same-name-custom-field-makes-me-confused-when-trying-to-add-same-name-field-to-screen
You can have different options for a custom field based on project or issue type. Not based on screens. Create different contexts for different options as described here: http://confluence.atlassian.com/display/JIRA/Configuring+a+Custom+Field#ConfiguringaCustomField-Context
Yes, that's right. It won't work if you try to do it per issuetype per project. Did you instead try per issuetype and for all projects (global)? Does it work for you?
Based on what I see when I try to configure contexts, it appears that I can only have 1 context for a custom field per project. Is that correct? I modified the default context for my "system" custom field, and applied it to issue type "Support Issue" and project "Support Issues". When I add a new context, I can choose issue type "Data Extract" but I can't choose project "Support Issues". That option isn't even in the list.
That doesn't really work either. The second context forces me to choose a project. Therefore, if I have 3 issue types for the same project (which I do) and I need different values available for each issue type, I can't seem to configure this. Context 1 is global for issue type 1, context 2 is project specific for issue type 2, and I can't tie context 3 to the specific project, or make it global.
There is a remarkably detailed description of what custom field contexts can be used for, including issue types, at https://www.servicerocket.com/blog/2014/04/field-context-in-atlassian-jira/
I know this is an older conversation, but figured I'd add this in case anyone is searching for the same item (like myself): https://jira.atlassian.com/browse/JRA-6851
Any solution to it? Even after couple of JIRA releases we face the same problem.
I'm using the Behaviours functionality of the Script Runner plugin for this (paid plugin). Not ideal as this should be a built-in function, but it works for us since we needed the plugin for other tasks anyway.
How you achieved multiple context per project using script runner plugin. Can you share your thoughts.
Another way to have a field default to a specific value is within the workflow. Go to the transition and add a Post Function > Update Issue Custom Field (and type in your default value). This method will be issue type agnostic and can be shared across multiple projects, so long as they share the same workflow. Enjoy!
Can anyone update me on how they have managed to achieve this multiple contexts per project? I have several issue types within a project that all need to display different options in the one Custom Field. I would love to know how anyone has achieved this?
thanks!
Log in as an admin, go to the list of custom fields and find your field, then click configure. You'll be able to add many contexts, one for each issue type.
There is a problem with it, which is what this question is about - you can only do one set of contexts, based on issue or project
This has been re-opened in the following tickets:
https://jira.atlassian.com/browse/JRASERVER-66849
https://jira.atlassian.com/browse/JRASERVER-67152
Hi,
It could be late but may help others who are still looking for the solution
In behaviour add a mapping for the required project(s) and required issuetype(s)
go to the fields in that newly created mapping
add the required field whose value to be limited for this mapping from 'Add Field'
Click on the 'Add server-side script' and put your code there
import com.atlassian.jira.component.ComponentAccessor;import com.onresolve.jira.groovy.user.FieldBehaviours;import groovy.transform.BaseScript;@BaseScript FieldBehaviours fieldBehaviours;def customFieldManager = ComponentAccessor.getCustomFieldManager();def optionsManager = ComponentAccessor.getOptionsManager();def customfield = customFieldManager.getCustomFieldObject("customfield_1xxx5");def customfield_config = customfield.getRelevantConfig(getIssueContext());def customfield_options = optionsManager.getOptions(customfield_config);def customfield_optionA = customfield_options.getOptionById(1xxx1).getValue();def customfield_optionB = customfield_options.getOptionById(1xxx2).getValue();def customfield_optionC = customfield_options.getOptionById(1xxx3).getValue();def formfield = getFieldById("customfield_1xxx5"); // same customfield as aboveformfield.setFieldOptions(customfield_options.findAll{it.value in [customfield_optionA,customfield_optionB});
This is a working solution for select list field. You can adapt the script for other field types
Hope it will help someone
Thanks,
-Amit
Thank you!! it works
It looks like you're new here. Sign in or register to get started.