Forums

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

Lables and Fix Version/s filed value are not set via JavaScript JIRA Issue Collector

Sanjeet Chauhan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 1, 2021

I am in the situation that I have been provided javascript code to integrate JIRA Issue Collector on a web page which seems to be fine. I try to set Lables and Fix Version/s fields default value by provided javascript by setting fieldValues object like below

fieldValues: {

Labels: 'mylabel' // also tried ['mylable'],

'Fix Version/s': 'myVersion'

}

When I create a bug from issue collector I do not see these value in the created bug.

Issue collector template form is "Raise a bug" type

Is it even possible ? Or am I doing something wrong?

1 answer

0 votes
Leo
Community Champion
September 7, 2021

Hi @Sanjeet Chauhan,

I'm not quite good with javascript. but you can refer this article for methods to set default values: https://confluence.atlassian.com/adminjiraserver089/advanced-use-of-the-jira-issue-collector-1005346607.html

and all the fields used here are written with their IDs not with their names

like summary is id of "Summary" and "customefield_xxxxx" for custom field

likewise you may need to update the script with those fields IDs instead of names 

 

Along with that both fields works as multi-selector. so you may need to consider passing the values as List

snippet for passing as list

fieldValues : {
 <field ID> : [ 'Value 1', 'Value' ]
}

Hope this helps

 

BR,

Leo

Suggest an answer

Log in or Sign up to answer