Is there a limit on how many contexts can be set for a custom field ?
https://support.atlassian.com/jira-cloud-administration/docs/add-a-context-to-a-custom-field/
In our usecase we need to automatically set a value to a field based on a particular project, eg.
Field XXX = 'aaa' when an issue is created in project 'PROJAAA'
Field XXX = 'bbb' when an issue is created in project 'PROJBBB'
So maybe there 's an alternative solution ?
thx !
Hi Dimitri,
You don't use a context for that. Contexts are used to show a field or hide a field based on the context, not to populate it.
But you can use an Automation Rule to do what you want. Here is more information on Automation if you are not familiar with it.
There are two types of automation:
Automation Basics: https://www.atlassian.com/software/jira/guides/expand-jira/automation
You can do this via global rules to apply to all projects also. You'll need to be a Jira Admin/Site Admin, go to Jira Settings > System > Automation Rules (left-hand menu).
For more on using Automation For Jira see these help pages.
Jira Automation Template Library to help get you started quickly:
https://www.atlassian.com/software/jira/automation-template-library#/labels/all/customLabelId/1453
To answer just the numbers question, see https://community.atlassian.com/t5/Jira-Software-questions/What-is-the-maximum-number-of-contexts-recommended-for-a-custom/qaq-p/1794968
Hi,
THanks for your suggestion, I did look into that but couldn't make it work for my usecase.
First of all, the value to be inserted depends on the project, so there should be mapping somwehere. I didn't found an easy way to do (& maintain) this, besides creating a bunch of IFs.
Secondly, this is a mandatory field, from what I can experience, the automation fails on this as the automation happens onthe Create event.
So unless there's a solution for these, I cannot use automation.
(ps. this should have been way easier with a simple groovy script in scriptrunner and an external (db) table )
You should be able to just substrting the key value up to the dash (-) and use the project key value to insert into the field. You won't need a bunch of IF statements for that - just one rule.
That's the thing, the value to be inserted is not the project key but a corresponding value from a hashmap/array.
Maybe my simple usecase example was not clear enough
Field XXX = 'PPPPPPPP' when an issue is created in project 'PROJAAA'
Field XXX = 'GGGGGG' when an issue is created in project 'PROJBBB'
Map: {PROJAAA=PPPPPPPP, PROJBBB=GGGGGG}
It looks like you're new here. Sign in or register to get started.