The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Ankush Sharma
Contributor
January 7, 2020

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

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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
Contributor
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
Contributor
January 8, 2020

Thank You.

TAGS
AUG Leaders

Atlassian Community Events