Trouble with default values in Issue Collector

Peter Dittman March 7, 2013

Trying to create a simple issue collector to give our non-JIRA users a way to request accounts, etc. I have a basic, out of the box implementation (locally hosted on my laptop - for experimentation). Have a basic issue collector, creating issues (issue-type "Task") in my project - all that seems to work fine, but I'd like to set the Priority field to "normal" or "non-critical", but when using the fieldValues in the test, it's not setting the value in the created task.

Here's the simple code to display the issue collector:

<html>
<body>
<h1>JIRA Request - Localhost!</h1>

<script type="text/javascript" src="http://localhost:8080/s/en_USclb6b2-418945332/846/3/1.2.9/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?collectorId=eb2f7ebc"></script>

<script type="text/javascript">
window.ATL_JQ_PAGE_PROPS = $.extend(window.ATL_JQ_PAGE_PROPS, {
 
    // ==== custom trigger function ====

    triggerFunction : function( showCollectorDialog ) {
            //Requries that jQuery is available! 
            $('#myCustomTrigger').on( 'click', function(e) {
                    e.preventDefault();
                    showCollectorDialog();
            });
       },
    // ==== we add the code below to set the field values ====
    fieldValues: {
        priority : '1'
    }    
});

</script>

    <a href="#" id="myCustomTrigger"><button>submit</button></a>

    </body>

</html>

It runs just fine, but when I look at the created task, there's no priority set.

I can modify the collector itself, add the priority field onto the screen, but that lets anyone who's using the form say their request is critical (are they ever?)... seriously, I'd really just like to default the priority to normal.

what am I missing?

2 answers

1 accepted

0 votes
Answer accepted
Peter Dittman March 11, 2013

resolved... wasn't working properly in locally hosted (on my laptop) instance, but worked ok for our on-demand JIRA version.

thanks.

-Peter

0 votes
John Chin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 10, 2013

Hi Peter,

Did you turn on the "Collect Browser Info" in Issue Collection configuration form? Hope its help.

Regards,

John Chin

Peter Dittman March 10, 2013

John, yes, "collect browser info" had been checked...

When I said the "Priority" field - I was speaking of the JIRA field value (e.g., blocker, critical, etc.). The code snipped above follows (almost to the letter) the documentation for Advanced Use of the issue collectors: https://confluence.atlassian.com/display/JIRA/Advanced+Use+of+the+JIRA+Issue+Collector#AdvancedUseoftheJIRAIssueCollector-SettingfieldvaluesfromJavaScript

not quite sure what the Browser Info might have to do with that, but regardless, it was checked when I tested the collector.

Suggest an answer

Log in or Sign up to answer