How do i set a default value for a custom field on a per Project basis

jennifer smith
Contributor
October 24, 2024

I have a Custom field that i want to set by default to a value.  This value is different for each Project.

For instance our ER project gets a default value of Sales

Our SW project gets a default value of Sustaining

Ideally this would be done on Create of the Issue.

 

 

 

2 answers

2 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 24, 2024

Hello @jennifer smith 

A Jira Administrator can define multiple Contexts for the custom field, creating a context for that field for each project. In each context the default value for the field can be set. With that functionality you can have a different default value for the field per project.

https://confluence.atlassian.com/adminjiraserver/configuring-custom-field-contexts-1047552717.html

jennifer smith
Contributor
October 24, 2024

yeah sorry this doesn't work.

I have a custom filed that is a cascading select list.  Every one of the fields configured those lists are applicable to all Projects.

Each project has a different default.  That is what I'm trying to set on a create of an issue.

 

The reason i don't want to duplicate all the configurable contexts on a per project basis is because there are hundreds

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 24, 2024

You could look at a third party plugin like Adaptavist ScriptRunner, specifically the Behaviours feature, for setting the default value dynamically within the Create Issue dialog.

https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira?hosting=datacenter&tab=overview

https://docs.adaptavist.com/sr4js/latest/features/behaviours

Like Fazila Ashraf likes this
jennifer smith
Contributor
October 24, 2024

is there any tutorial that tells you how to do this yourself?

Its so frustrating that every time you want to do anything beyond the most basic functionality you can't because there isn't any documentation on how to do anything.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 24, 2024

I'm not sure what you mean by "do this yourself".

If you are looking for tutorials for how to set up Behaviours then the documentation link I provided includes a button that leads to training about that feature.

 

There may be other third party apps in the Atlassian Marketplace that provide similar functionality. Scriptrunner is the one I happen to use.

jennifer smith
Contributor
October 24, 2024

thanks - i'll take a look.  I appreciate the help

mostly i just don't want to have to buy an app every time i want to do something that should be included with the JIRA in the first place.

so frustrating.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 24, 2024

I sympathize.

Technically, though, Atlassian did provide a way to do what you want, as I initially described. It just is not convenient/efficient based on how you have otherwise customized your field.

If the design had allowed for setting a different default value per project but only one set of values for the field overall, other users could argue that would not be an effective design.

In an ideal world there would be a way to optionally separate the select list values from the default value so that a single selection list could be shared by all contexts, or each context could have its own selection list.

jennifer smith
Contributor
October 24, 2024

is there a way to use the property key to set the field value on create since we can't purchase scriptrunner

 

 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 24, 2024

Are you referring to Workflow Properties?

https://confluence.atlassian.com/adminjiraserver/workflow-properties-938847526.html

If so, no, you can't use these properties to set a default value for a field in the Create Issue dialog.

If those aren't the properties you mean, can you provide more information or a link to the documentation for the properties to which you are referring?

0 votes
Nicketa November 15, 2024

Hello @jennifer smith ,

 

Do you mean like this: 

Screenshot 2024-11-15 155512.png

 

BR,

Nicketa

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 16, 2024

Hello @Nicketa 

That is using the Context feature I mentioned in my first response. @jennifer smith said that is not an acceptable solution because all the projects use the same list and they don't want to create and maintain multiple copies of an identical list.

Like Nicketa likes this
Nicketa November 27, 2024

Yes, got it. Just wanted to check if there is any confusion.

Nicketa November 27, 2024

@jennifer smith ,

 

I have a custom filed that is a cascading select list.  Every one of the fields configured those lists are applicable to all Projects.

Each project has a different default.  That is what I'm trying to set on a create of an issue.

 

The reason i don't want to duplicate all the configurable contexts on a per project basis is because there are hundreds

 

Try:

  • Field configuration
  • Workflow post function to set a value with customized conditions.
  • Automation for Jira plugin to update the value.

 

BR,

Nicketa

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events