issues, extensions and bitbucket
Sean Farley
sean at farley.io
Fri Jul 7 21:37:55 UTC 2017
Uwe Brauer <oub at mat.ucm.es> writes:
>>>> "Sean" == Sean Farley <sean at farley.io> writes:
>
> > Uwe Brauer <oub at mat.ucm.es> writes:
>
> >> Hi
> >>
> >> Right now I use the artemis for local issues and I am quite
> >> pleased with it.
> >>
> >> On the other hand I also use bitbucket issue system, which is
> >> nice as well.
>
> > I don't know if I've ever heard anyone say that.
>
> Well besides German politeness, I have to say that the tracker fits my
> needs, the only other issue system I know is github, which have rarely
> used and did not find much better.
:-)
> >> The problem is: there seems to be no interface between the
> >> bitbucket issue system and a local one.
> >>
> >> Does anybody know about such a tool/extension or how to deal with
> >> this problem?
>
> > I have not heard of one but if you're game, I'd help guide you for
> > writing your own via our API (it might require some new API stuff on our
> > end, which would be a good thing).
>
> Hm meanwhile I wrote to the artemis author who told me that he is very
> interested in that subject and tried it for some time to play with the
> API without success. So it seems difficult.
Our issues api has some warts for sure. Luckily, I can work on that side
if the need is there (and my time allows).
> Just out of curiosity I downloaded the issues of my repo in json format
> and found a online converter which transforms it to, alas, xls (excel).
>
> Any intentions to have a simple (UTF/ascii) text exporter in addition
> to the json one?
I don't know what format you want as output but it's pretty simple to
read the json in python and output whatever you want. For instance, if
you want to get all your issues that are tasks:
import json
import requests
pr_url = 'https://bitbucket.org/api/2.0/repositories/%s/%s/issues?q=kind="task"'
bb_user = 'petsc'
bb_repo = 'petsc'
def main():
next_url = pr_url % (bb_user, bb_repo)
issues = set()
while next_url is not None:
ret = requests.get(next_url)
paginated_issues = json.loads(ret.text)
next_url = paginated_issues.get('next')
for pr in paginated_issues['values']:
issues.add(pr['title'])
print issues
if __name__ == "__main__":
main()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20170707/827a5d01/attachment.asc>
More information about the Mercurial
mailing list