pythonrallypyral

Rally python api - Adding a Tag to an entity?


I wanted to use pyral to add tags to defects and I couldn't figure out how to do it

info = dict(test_id="ABC", platform="AAA")
tag1 = rally.create('Tag', dict(Name=info['test_id']))
tag2 = rally.create('Tag', dict(Name=info['platform']))

what's next ?


Solution

  • found an answer here: how to tag a defect using rally Javascript API

    anyhow adding it to documentation might help:

    tag1 = rally.create('Tag', dict(Name=info['test_id']))
    tag2 = rally.create('Tag', dict(Name=info['platform']))
    
    tags = [ dict(_ref=tag1.ref), dict(_ref=tag2.ref)]
    
    defect = { "Tags" : tags }