The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OH, those are different values for Field XXX that what you showed in the initial example. That would indeed be several IF statements.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, sorry about that, I guess I oversimplified my example.
Yes, so many IF's is not possible .. thanks for your suggestion though.
That's why - for now- my ugly workaround is to set a context per Project and assign a default value to the field manually :-/
I'll continue to see whether I cannot use a scripted field instead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.