This question is in reference to Atlassian Documentation: Advanced use of the JIRA issue collector
For example I want to set the field description required when submitting an issue via a given Issue Collector.
The field description is optional in JIRA with no intention to set it required. How can I do?
Looking further into the Advanced use of the JIRA issue collector documentation, I also don't understand the usage of the fieldValues properties as a function. What does it do? Can I use this function to achieve my goal?
Eventually I ended up with my own Custom Issue Collector.
The goal is to mimic the behaviour of the native JIRA Issue Collector while offering more flexibility.
You click on a button to open a form, and you click on submit to create the issue.
Every Custom Issue Collector has its own label to stamp the issues created through it.
Form:
https://www.formget.com/how-to-create-pop-up-contact-form-using-javascript/
Submit using REST API:
https://api.jquery.com/jQuery.ajax/
https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis
Code in Confluence macro HTML:
$.ajax({ type: "POST", url: "https://ourdomain/jira/rest/api/2/issue/", dataType: "json", contentType: "application/json", data: JSON.stringify(issue), async:false, xhrFields: { withCredentials: true }, success: function (data, status, result) { console.log("ajax call succeeded", data, status, result); popup_message(data.key); //show new issue with clickable link and submit the form }, error: function (result, status, error) { console.log("Internal Error ajax call", result, status, error); alert("Error:" +JSON.stringify(result) +"," +status +"," +error +"."); }, });
CONF URL = https://ourdomain/confluence.
JIRA URL = https://ourdomain/jira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another interesting solution would be to mimic the predefined JIRA Issue Collector named Got Feedback?.
Creating a new JIRA Issue Collector from the Issue Collector template named Got Feedback? produces a screen with any fields (not JIRA fields) all required.
At submit the values entered at the Issue Collector fields are grouped and inserted within the JIRA issue description.
How can we create such a similar custom JIRA Issue Collector?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Basically there would be a simple solution if I could patch the HTML before showing the JIRA Issue Collector dialog.
Example with 3 fields Summary, Severity (a custom field), and Description of type string, list, and text.
The HTML on the page contains 3 elements:
<input class="text long-field" id="summary" name="summary" type="text" value=""> <select class="select" name="customfield_10159" id="customfield_10159"> <option value="-1">None</option> <option value="10030">Critical</option> <option value="10031">Serious</option> <option value="10032">Non-critical</option> </select> <textarea class="textarea long-field wiki-textfield long-field mentionable" id="description" name="description" rows="12" wrap="virtual" data-projectkey="CMTOOLSPRCR" style="overflow-y: auto; height: 200px;"></textarea>
My need would be achieved if patching the HTML as follow:
<input class="text long-field" id="summary" name="summary" type="text" value="" required=""> <select class="select" name="customfield_10159" id="customfield_10159" required=""> <option value="">None</option> <option value="10030">Critical</option> <option value="10031">Serious</option> <option value="10032">Non-critical</option> </select> <textarea class="textarea long-field wiki-textfield long-field mentionable" id="description" name="description" rows="12" wrap="virtual" data-projectkey="CMTOOLSPRCR" style="overflow-y: auto; height: 200px;" required=""></textarea>
Which consists in:
The thing is I don't know how to do this. Any clue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.