ncatlabs / pydradis

Dradis API Python Wrapper
https://labs.novacoast.com/
GNU Lesser General Public License v3.0
14 stars 9 forks source link

Clarification on Issue Update #1

Open leesoh opened 6 years ago

leesoh commented 6 years ago

Hi there,

First off, thanks for building this! I'm excited to put it to use. I have a quick question regarding the update_issue method. Does it currently only support updating title and description? If it supports updating all fields in an issue, can you provide an example of what that would look like?

leesoh commented 6 years ago

Doing something like this seems to work, but it's hacky:

pd.update_issue(project_id, issue_id, 'This is a title', 'Description is here\r\n\r\n#[Header]#\r\nhiiii')

results in:

#[Title]#
This is a title

#[Description]#
Description is here

#[Header]#
hiiii
pmsosa commented 6 years ago

Thats initially how it's meant to be used as there are no assumptions as to what fields you are specifying, thus giving you the flexibility to define whatever body you want.

Perhaps we could look into changing the update method such that one doesn't have to take care of the formatting but can simply define a dictionary of fields & their accompanying text.

leesoh commented 6 years ago

Yeah, that's what I was thinking as well. Looking at the Dradis API documentation, the issue update method expects a string ('#[Title]#...'), although the get issue's field key contains a dict that would be lovely to just send back modified, but as it is today it looks like it would need to be parsed into a string first.

leesoh commented 6 years ago

Took a stab at it here: https://github.com/leesoh/pydradis/blob/dev/pydradis.py#L560