Osm Dev
Osm Dev

Reputation: 97

Can't set value for 'Environment' field in Jira using Jira REST Java Client

I am not seeing any issueBuilder method to set value for 'Environment' field in 'issue creation'. Environment field is not hidden. I can see it on my 'Create issue' screen.

Upvotes: 3

Views: 1126

Answers (2)

Antony Kovlyashenko
Antony Kovlyashenko

Reputation: 46

There are no special method for "environment" field in builder, but you can use method setFieldValue, f.e.: builder.setFieldValue("environment", "Some value")

Upvotes: 1

Webomatik
Webomatik

Reputation: 836

The environment field is accessible upon creation using the REST API, under the "fields" group: JIRA 6.4.12 REST API Documentation

So the "fields" array looks like this in PHP:

"fields" => array(
    "project" => array("key" => 'WHATEVER'),
    "summary" => $summary,
    "description" => $description,
    "environment" => $environment,
    "issuetype" => array("id" => $issueType)
)

Make sure that the "environment' field is part of your default screen for that project. If not, the issue creation will fail.

Upvotes: 1

Related Questions