code: def change_jira_status(test_key, test_status, test_comment, test_attachments):
      
      logger = logging.getLogger(__name__)
  
      if not execution_url:
          logger.warning("Test Case '%s' can not be updated: execution_url is not configured", test_key)
          return
  
      logger.info("Updating Test Case '%s' in Jira with status %s", test_key, test_status)
      composed_comments = comments
      if test_comment:
          composed_comments = '{}\n{}'.format(comments, test_comment) if comments else test_comment
      payload = {'jiraTestCaseId': test_key, 'jiraStatus': test_status, 'summaryPrefix': summary_prefix,
                 'labels': labels, 'comments': composed_comments, 'version': fix_version, 'build': build}
      if only_if_changes:
          payload['onlyIfStatusChanges'] = 'true'
      try:
          if test_attachments and len(test_attachments) > 0:
              files = dict()
              for index in range(len(test_attachments)):
                  files['attachments{}'.format(index)] = open(test_attachments[index], 'rb')
          else:
              files = None
          response = requests.post(execution_url, data=payload, files=files)
      except Exception as e:
          logger.warning("Error updating Test Case '%s': %s", test_key, e)
          return
  
      if response.status_code >= 400:
          logger.warning("Error updating Test Case '%s': [%s] %s", test_key, response.status_code,
                         get_error_message(response.content))
      else:
          logger.debug("%s", response.content.decode().splitlines()[0])
docs: Update test status in Jira
  
      :param test_key: test case key in Jira
      :param test_status: test case status
      :param test_comment: test case comments
      :param test_attachments: test case attachments