We have developed some code to contact JIRA using Python and jira2.0 python packge
anyway sometimes we got "We cannot instantiate empty resources: {}" error in the log. any clues on this ?
We can't help you with a problem that's in your own code, especially if you have not given us the code.
You'll need to debug why the resource is empty in your code.
Hi Nic,
Error coming from one of below methods
def sync_comments(issueSource,issueDestination,instanceSource,instanceDestionation,last_run_time,last_run_time_upper_bound,side): logging.info("Synchronizing issue comments - new issues")try: issue = instanceSource.issue(issueSource.key) comments = issue.fields.comment.commentsfor comment in comments:if comment.author.name != 'lse_jira_sync_user' and comment.author.name != 'lse_sync_user': instanceDestionation.add_comment(issueDestination, build_comment(comment, side))except JIRAError as e: logging.info(e)print(e)
def sync_attachments(issueSource,issueDestination,instanceSource,instanceDestionation,last_run_time,last_run_time_upper_bound): logging.info("Synchronizing issue attachments - new issues")try: issue_source = instanceSource.issue(issueSource.key)for attachment in issue_source.fields.attachment:if attachment.author.name != 'lse_jira_sync_user' and attachment.author.name != 'lse_sync_user': image = attachment.get() jira_filename = attachment.filenamewith open("attachments/" + jira_filename, 'wb') as out_file: out_file.write(image)with open("attachments/" + jira_filename, 'rb') as f: instanceDestionation.add_attachment(issueDestination,f)if os.path.exists("attachments/" + jira_filename): os.remove("attachments/" + jira_filename)except JIRAError as e: logging.info(e)print(e)
Also this is not for all tickets, but sometimes we are getting this error, and it was not there in the staging server. this happens only after production push
You'll need to go through your code to work out where the empty resource is being returned.
It looks like you're new here. Sign in or register to get started.