Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Update context for custom field with scriptrunner

arielei
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2025

Hello Community,

I have custom fields that are set Globally.

I want to change them to specific projects.

 

i have an array of project keys that i want to run a script that will update the CF context.

for example, the array or project keys to set: [WHMKUK, WHH, WEBS]

is this possible via script runner in jira DC?

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Jayesh Raghuvanshi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 25, 2025

@arielei 
No, you can't use a Script Runner script to directly update the context of a custom field in Jira Data Center (DC). This type of change is typically made through the Jira UI because it involves modifying the core configuration of the custom field and its associated contexts.

Custom Field Context and Configuration
In Jira, a custom field can have different contexts, which define its behavior based on project and issue type. When you create a custom field, you can set it to apply to all projects (Global context) or to specific projects and issue types. The list of projects you want to apply the custom field to is what's known as the custom field's scope.

The script's primary role in Jira is for automation tasks like:

Creating a new issue.

Automating transitions.

Checking field values.

Validating input.

Modifying the context of a custom field, which involves adding or removing projects, is considered a Jira configuration change, not a routine automation task. While you can access and read custom field configurations with Script Runner, writing or updating these settings is not an available function.

Alternative Solution
The recommended way to change the custom field context is by manually navigating to the custom field configuration in the Jira UI.

Navigate to Jira Administration ⚙️ > Issues > Custom Fields.

Find the custom field you want to modify.

Click the 3 dots (...) under the Actions column for the custom field and select Configure.

On the custom field configuration page, click Edit Context to change the projects and issue types the custom field applies to.

In the context editor, you can select or deselect the projects you want the custom field to be available in.

DEPLOYMENT TYPE
SERVER
VERSION
9.4.17
TAGS
AUG Leaders

Atlassian Community Events