Is there a way to set the default component for a specific issue type in a project?
As far as I can find on Google this is not possible in standard JIRA?
The only way I can see is inserting JavaScript into the create issue screen, for example using the description of the Component/s field. However, there doesn't seem to be an easy way to programmatically change the autocomplete value and have it update its view?
I can update the internally used value using the following:
AJS.$('#components').val(["14371"]).trigger("change");
Where 14371 is the component ID and the value in the option tag for the component. But this call does not update the component selector's view. Updating the view myself seems even more hacky and dangerous when thinking about breakage in future updates.
Does anyone know of a way to update both the value of the selector and its view?
Community moderators have prevented the ability to post new answers.
Little tricky, but you will need to use the both line together, the first will truly select the components, the second will display it to user:
AJS.$("#components").val(11902); //11902 is id of "My Component" AJS.$("#components-textarea").val("My Component").blur();
Yes there is no default for that - except for JIRA service desk. There you can set a component value in the screen for service desk.
You could edit the workflow to set the component to some value while the create process.
Not the most elegant solution but this works - but you have to set another workflow for each issuetype.
A better solution would be a conditional post function setting this value based on the issuetype.
With Misc Workflow Extensions or ScriptRunner this is possible.
Hope this could help.
Greets
Simon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.