Forum Discussion

mdh's avatar
mdh
Contributor
10 years ago

Report Jira issue from TC - Priority fields are emty

Have a couple of issues here.



I'm using TC 10.40.2015.7     - here my 3 things in a box :-)



1) When trying to report a Jira issuie, the priority fields are emty (except the undefined one), the 3 other priority fields are just blank,  see image.



The reported error are actually creatid in Jira, and If I select one of the blanks, the corresponding priority are also set -  so the issue is that TC can't get the priority text from Jira



2) When trying to attach a log file (just a small one) thsi fails, see TC exception image attached



3) Why are OS system details put to 'Environment'  field ? and not as an attachment. We allready use the Environment field for something else.  





  • Hi Morten,



    > Which tool do I use to edit the tcx file ? TestComplete?



    .tcx file contains several files inside as per requirements to Script Extensions (see relevant TestComplete help topic for more details). You will have to edit the code files (.js and/or .vbs) using whatever tool you like (including TC).

    If you happen need to edit form files as well (.aqfrm) then I think that TestComplete will be the best choice.
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Morten,



    > Which tool do I use to edit the tcx file ? TestComplete?



    .tcx file contains several files inside as per requirements to Script Extensions (see relevant TestComplete help topic for more details). You will have to edit the code files (.js and/or .vbs) using whatever tool you like (including TC).

    If you happen need to edit form files as well (.aqfrm) then I think that TestComplete will be the best choice.
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Morten,



    If I got your problem right...

    The Jira support in TestComplete is just a script extension. You can find it in the <TestComplete 10>\Bin\Extensions\ScriptExtensions\JiraSupport.tcx file which is a zip archive with the .tcx extension.

    Unpack archive to some subfolder below its parent one, change the extension of the original file to something else and feel free to modify the extension as per your needs. (Don't forget to reload extension in TestComplete after you make some changes.)

    Does this help?
  • mdh's avatar
    mdh
    Contributor
    I allready had this extension installed and selected, see image



    The tcx file are not zipped though???



    Which tool do I use to edit the tcx file ? TestComplete?
  • mdh's avatar
    mdh
    Contributor
    Ok, got it now - it helped a lot when I unzipped the tcx file :-) .... seems that the help topic will be suffiecient
    • mdh's avatar
      mdh
      Contributor

      Hi Alex

       

      I now managed to modify the Atlassian_JIRA_ReportBug.js and the two forms to fit most of my needs.

      I'm using Jira version 5.1 (and 6.04 for another site)

       

      The only thing missing now is that CreateBug function do not return the bug id correctly (bug.key). 

      It's used to open Jira and the created bug in the browser.

       

      The  aqDlg.ShowMessage(xml_response_obj.xml);  shows that the <key xsi:type=soapenc:string">SANDBOX-155<"/key> are present in the XLM

       

      Maybe the ParseResponse do not parse the results correctly ??, as I also had similar issue with the priorities (which I ended up solving by hardcoding the priorities array in the Atlassian_JIRA_ReportBug.js)

       

      Here part of the .js :

       

      function PostBugToJIRA(http_request_obj, param)
      {
      var text;
      var form = UserForms.JIRA_DefectInfoForm;
      var web_service_info = GetWebServiceInfo();
      var status_text = form.cxMemo_Progress.Lines;

      if (aqString.GetLength(m_summary_name) == 0)
      {
      status_text.Add(umsg_empty_bug_name_error);
      return false;
      }

      try
      {
      status_text.Add(umsg_server_creating_bug);
      bug = CreateBug(http_request_obj, web_service_info);
      status_text.Add(bug.fix)
      status_text.Add(bug.key);
      status_text.Add(umsg_server_bug_created);
      }
      catch(ex)
      {
      status_text.Add(ex.description);
      LogoutFromServer(http_request_obj, web_service_info);
      return false;
      }

      if (m_add_log_file)
      {
      try
      {
      status_text.Add(umsg_server_log_converting);
      var base64_converted_data = aqObject.encodeBase64(aqFile.ReadWholeTextFile(param, aqFile.ctANSI));
      status_text.Add(umsg_server_log_converted);
      // DEBUG
      //aqDlg.ShowMessage(aqString.GetLength(base64_converted_data));
      status_text.Add(umsg_server_sending_attach + " Size : " + aqString.GetLength(base64_converted_data));

      //if (AddAttachmentToBug(http_request_obj, web_service_info, bug.key, param, base64_converted_data) == false)
      if (AddAttachmentToBug(http_request_obj, web_service_info, param, base64_converted_data) == false)
      throw new Error(0, "");
      status_text.Add(umsg_server_attach_sended);
      }
      catch(ex)
      {
      status_text.Add(umsg_error_attach_not_sended);
      if (ex.description != "")
      status_text.Add(ex.description);
      // DEBUG
      var bug_temp_key = " emty !";
      // status_text.Add(aqString.Format(umsg_posted_bug_key, bug.key));
      status_text.Add(aqString.Format(umsg_posted_bug_key, bug_temp_key));
      LogoutFromServer(http_request_obj, web_service_info)
      status_text.Add(umsg_server_logout);
      return false;
      }
      }

      LogoutFromServer(http_request_obj, web_service_info);
      status_text.Add(umsg_server_logout);
      //DEBUG

      //status_text.Add(umsg_operation_completed_sucsessfully + "\r\n" + aqString.Format(umsg_posted_bug_key, bug.key));
      status_text.Add(umsg_operation_completed_sucsessfully + "\r\n" + aqString.Format(umsg_posted_bug_key, m_project_key));

      //if (aqDlg.MessageDlg(aqString.Format(umsg_open_defect_in_browser, bug.key), 0, 1|2) == 6)
      if (aqDlg.MessageDlg(aqString.Format(umsg_open_defect_in_browser, bug_id), 0, 1|2) == 6)

      {
      var shell = new ActiveXObject("Shell.Application");
      // shell.ShellExecute(m_server_name + aqString.Format("/browse/%s", bug.key)); // e.g. .../SANDBOX-155
      shell.ShellExecute(m_server_name + aqString.Format("/browse/%s", m_project_key));
      }

      • mgroen2's avatar
        mgroen2
        Super Contributor

        Is it somehow possible to change Jira Bug script extension so that it can post attachments, which are relevant for the bug, as well to Jira?