I'm trying to add a static comment into multiple defects at the same time. I was able to use jira.add_comment to add it into a single defect. But i'm not sure how it can be done for multiple defects at the same time. i tried reading the defect id's from the text file to add comments in multiple defects. But that didn't work. Please let me know how this can be done using Python script.
from jira import JIRA
options = {'server': 'https://jira.com'}
jira = JIRA(options, basic_auth=('username', 'pwd'))
f = open('C:////jiraccess//defect.txt')
line = f.readline()
while line:
comment = jira.add_comment(line, 'closed')
line = f.readline()
f.close()
readline() includes the newline character(s), which causes a problem when looking for that issue ID in the add_comment() method. Add a call to rstrip() to remove it/them; be sure to do so on both calls to readline().
f.readline().rstrip()
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.