Hello everyone,
We have an integration between our monit system and python, some of the code works (below) but fails when editing the field. No error is returned.
def add_jira_comment(self, issue_id, comment):
logging.info("Add comment for issue in Jira: %s " % issue_id)
jira = self.jira_obj()
jira.add_comment(issue_id, comment)
jira_issue = self.constr_issue_dict(issue_dict)
#This works nice
self.add_jira_comment(issue_dict['jira_id'], "[automatic] Alert was Forced OK")
# None of the below works
jira_issue.update(fields={'customfield_10121' : 'OK'})
jira_issue.update(customfield_10121='OK')
I've been looking for the issue through the forum trying a lot of fixes but no luck so far, anyone able to give some light to the issue? Im a bit lost rn.
Now it works, new code for anyone that is as lost as i was:
jira = self.jira_obj()
issue = jira.issue('jira_id')
issue.update(fields={'customfield_10121': 'OK'})
Btw, the customfield is editable by anyone, so i guess there's no problem on the permissions department
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried with all these so far (no results):
#custom_field_value = "OK"
#field = "customfield_10121"
#jira_issue.update(fields={'customfield_10121': 'OK'})
#issue.update(fields={'customfield_10121': 'New value'})
#jira_issue.update({"customfield_10121":[{"name" : "OK"}]})
#jira_issue.update(fields={"customfield_10121": custom_field_value})
#jira_issue.update(fields={'customfield_10121' : 'OK'})
#jira_issue.update(customfield_10121='OK')
#jira_issue.update(customfield_10121={'name': custom_field_value})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.