title: Switch statement in JavaScript not working
body: <p>In the following script I have two callback functions: getProjectKey() and getWorkflowSchemeName().</p>
  
  <p>I've passing a variable 'workflowSchemeName' in the switch statement, although I can see in the debugger that the value is coming but the switch statement doesn't work and keeps running on the default case.</p>
  
  <p>Following is the code. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>if (AJS.$("#issue-create-submit").val() == "Create" || AJS.$("#create-issue-submit").val() == "Create") {
    inputTag = AJS.$("#project")[0];
    projectId = inputTag.value;
  
    var projectKey;
    var workflowSchemeName;
  
    function getProjectKey(projectId, callback) {
      console.log("Project ID is (inside function): " + projectId);
      var restCall = AJS.params.baseURL + "/rest/api/2/project/" + projectId;
  
      AJS.$.get(restCall, function(response) {
        callback(response);
        console.log(" REST PROJECT KEY IS : " + response.key);
      })
    }
  
    function getWorkflowSchemeName(projectKey, callback) {
      var restCall = AJS.params.baseURL + "/rest/projectconfig/1/workflowscheme/" + projectKey;
  
      AJS.$.get(restCall, function(response) {
        callback(response);
        console.log(" REST WorkflowScheme Name is: " + response.name);
      })
    }
  
    if (projectId != null) {
      getProjectKey(projectId, function(response) {
        projectKey = response.key;
        console.log("*************** PROJECT KEY IS : " + projectKey);
  
        if (projectKey != null) {
          getWorkflowSchemeName(projectKey, function(resp) {
            workflowSchemeName = resp.name;
  
            // Getting the WorkflowSchemeName till here. CAN see it in the console. 
  
            console.log("*************** WORKFLOWSCHEME IS : " + workflowSchemeName); // Can see this. 
  
            if (workflowSchemeName != null) {
              switch (workflowSchemeName) {
  
                // FAILING HERE
                case "SW Work Flow Scheme":
                  console.log("SOFTWARE New Content Inside condition ");
                  AJS.$(".field-group").children('label[for=description]').append('&lt;span class="aui-icon icon-required"&gt;&lt;/span&gt;');
                  AJS.$(".field-group").children('label[for=customfield_10105]').append('&lt;span class="aui-icon icon-required"&gt;&lt;/span&gt;');
                  break;
  
                case "HW Workflow Scheme":
                  console.log("HARDWARE New Content Inside condition ");
                  AJS.$(".field-group").children('label[for=description]').append('&lt;span class="aui-icon icon-required"&gt;&lt;/span&gt;');
                  break;
  
  
                  // DEFAULT CASE ALWAYS RUNS. 
  
                default:
                  console.log("A new workflow scheme is detected. Need to update the Scripts Plugin in Create Issue Screens");
              }
            }
          })
        }
      })
    }
  
    // Can't see these values here either. But separate Issue. 
    console.log("Project Key is ************** " + projectKey);
    console.log("WorkflowScheme Name is ******** " + workflowSchemeName);
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Can anyone please help me out, what am I doing wrong here? 
  Many Thanks.</p>