It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

1 answer

0 votes

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. 

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

Glad to hear that! 

Like Ankush_Sharma likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you