Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is it possible to set fieldValues.components to a variable within a JIRA Issue Collector?

Nick Hamberg October 9, 2015

I am trying to change the component of an issue based on which button (image) is clicked. I verified the fieldValues part works fine when using a value, even with the multiple IDs. I've verified the switch/case statements are working. When using the code below, I get an error, which I assume is the component  piece failing. Is this possible? Or is there a better way to do what I need? I am doing this within a Confluence HTML Macro.

<script type="text/javascript">
var componentId;
	window.ATL_JQ_PAGE_PROPS = {
		"triggerFunction": function(showCollectorDialog) {
			jQuery("#button1, #button2).click(function(e) {
				e.preventDefault();
				showCollectorDialog();
				switch($(this).prop('id')){
					case 'button1':
						componentId = '10000';
						break;
					case 'button2':
						componentId = '20000';
						break;
				}
			});
		},
		fieldValues:{
			components: componentId	
		}	
	};
</script>
 
<input type="image" src="http://confluence.com/image1.png" id="button1" />
<input type="image" src="http://confluence.com/image2.png" id="button2"	/>


Update: I've created a working solution by using multiple collectors instead of changing variables with a single collector. Not ideal, but it will be fine.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Nick Hamberg October 12, 2015

The error is: "Oops! Something went wrong... Don't worry though! We've logged this problem and will look into it soon!"

0 votes
Steven F Behnke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 9, 2015

What is the error?

TAGS
AUG Leaders

Atlassian Community Events