It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Using jira-python

Areg Vrtanesyan Aug 29, 2013

Hi

I am trying to manipulate comments using the jira-python from http://jira-python.readthedocs.org and experiencing the following problems:

Adding comments is Ok, Deleting Ok but Updating is failing with error:

>>> comment.update('aa')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: update() takes exactly 1 argument (2 given)


Just would like to check if anyone expected same issues?

I am running it using python 2.7.5 on Jira 5.2.11.

Regards,

Areg

3 answers

1 accepted

0 votes
Answer accepted

I've logged at bug for this at https://bitbucket.org/bspeakmon/jira-python/issue/53/unable-to-update-a-comment

The bug has the details of a workaround that involved changing the jira-python code, but this snippet did work for me:

# Comments need to be retrieved in a separate step
        issue = jira.issue(issue.key, expand='comments')
        for comment in issue.fields.comment.comments:
            log.info("Comment: %s, %s, %s" % (comment.created, comment.author, comment.body))
            new_comment = '%s new1' % (comment.body)
            comment.update(new_comment)

0 votes

Hi

I made a changes in the code and it is worked !!!

Thank you very much.

Regards,

Areg

0 votes
Areg Vrtanesyan Sep 04, 2013

Hi

I made a changes in the code and it is worked !!!

Thank you very much.

Regards,

Areg

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Next-gen

Introducing subtasks for breaking down work in next-gen projects

Teams break work down in order to help simplify complex tasks. This is often done iteratively, with tasks being broken down into smaller tasks and so on until the work is accurately captured in well-...

987 views 12 15
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you