How to set value in environment field while creating issue via rest api

Ankush Sharma January 7, 2020

How to set value in environment field while creating issue via rest api.

1 answer

0 votes
Adrian Stephen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 7, 2020

Hi @Ankush Sharma 

Please refer to the example here:

{
"update":{
"worklog":[
{
"add":{
"timeSpent":"60m",
"started":"2011-07-05T11:05:00.000+0000"
}
}
]
},
"fields":{
"project":{
"id":"10000"
},
"summary":"something's wrong",
"issuetype":{
"id":"10000"
},
"assignee":{
"name":"homer"
},
"reporter":{
"name":"smithers"
},
"priority":{
"id":"20000"
},
"labels":[
"bugfix",
"blitz_test"
],
"timetracking":{
"originalEstimate":"10",
"remainingEstimate":"5"
},
"security":{
"id":"10000"
},
"versions":[
{
"id":"10000"
}
],
"environment":"environment",
"description":"description",
"duedate":"2011-03-11",
"fixVersions":[
{
"id":"10001"
}
],
"components":[
{
"id":"10000"
}
],
"customfield_30000":[
"10000",
"10002"
],
"customfield_80000":{
"value":"red"
},
"customfield_20000":"06/Jul/11 3:25 PM",
"customfield_40000":"this is a text field",
"customfield_70000":[
"jira-administrators",
"jira-software-users"
],
"customfield_60000":"jira-software-users",
"customfield_50000":"this is a text area. big text.",
"customfield_10000":"09/Jun/81"
}
}

Let me know if it doesn't work. 

Ankush Sharma January 8, 2020

i have to pass 

environment: {
type: 'doc',
version: 1,
content: [{
type: 'paragraph',
content: [{
type: 'text',
text: data.userData.environment
}]
}]
}

 

And this works for me.

Like Adrian Stephen likes this
Adrian Stephen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 8, 2020

Glad to hear that! 

Like Ankush Sharma likes this
Ankush Sharma January 8, 2020

Thank You.

Suggest an answer

Log in or Sign up to answer