Page tree
Skip to end of metadata
Go to start of metadata

Environment Custom Field Type is available since version 3.0 (experimental since version 2.5)

It is a good practice to create Environments custom fields to be displayed in your Jira issues as an alternative to the free text Environment field provided by default in Jira:

Why is it so important to use Environment Custom Fields?

The default “Environment” free text field that is provided by default by JIRA can be very ambiguous. Does it represent the environment on which I have detected my bug? Is it the environment used to test the bugfix we have just received? How is it possible to get accurate statistics (ex : number of issues detected on a an environment) based on a free text field?

If these questions sound familiar to your, it can really help you to start creating different Environment Custom Field. Like for version, creating different fields of type environment can really bring clarity for you and other JIRA users. We suggest you to start adding at least 2 environment custom fields to all your issues :

  1. Detected in: Environment in which a new issue has been detected
  2. Tested in: Environment in which a fixed issue has been tested

You can imagine many more, for instance Reproduced in, Demoed in, etc.

This concept is similar to the Version concept in Jira: you have only one list of Versions but you can have different fields of type Version on the same issue (ex: Fix Version/s and Affects Version/s).

Create an Environment Custom Field

You must be a Jira administrator in order to create a new Environment Custom Field.

If you have never created a custom field before, please read the Atlassian documentation in order to understand the concept:

Atlassian support: adding a custom field

Open the “Issues” administration panel, click then on Custom Fields (left menu) and follow these instructions:

You will then need to add the newly created Custom Field to your issue types' screens.

Select Environments on the Edit screen

If no Environment is set for an issue, you can add an Environment on the Edit screen:

Select Environments on the View screen

If an Environment is already set, you can click on the field to remove or add Environments:

Select Environments using the Jira REST API

You can edit the value(s) of an Environment custom field using the standard Jira REST API. The values of an environment custom field are set using an array of Strings representing the id’s of the associated environments.

Refer to the curl example below:

#update an environment custom field
#simply set an array with the id's of environments you want to set (ex: ["1","2","3"]) for your apwide environment customfield (ex: customfield_10200)

$ curl -D- -u admin:admin -X PUT --data '{"fields" : {"customfield_10200" : ["1","2","3"]} }' -H "Content-Type: application/json" http://localhost:2990/jira/rest/api/2/issue/NDT-1

  • No labels