Rally Python Api: добавьте обсуждение дефекта

Как я могу создать тему для обсуждения дефекта Rally с помощью Pyral?

Это то, что у меня есть до сих пор:

rally = Rally(server, user, password)
rally.enableLogging('rallyConnection.log')
rally.setProject("RallyTestPrj")

defectID = 'DE9221'
notes = "Adding new note from Python"
discussion = "Adding discussion from Python"

defect_data = { "FormattedID" : defectID,
                "Notes"       : notes,
                "Discussion"  : discussion
}

try:
defect = rally.update('Defect', defect_data)
except Exception, details:
sys.stderr.write('ERROR: %s \n' % details)
sys.exit(1)
print "Defect updated"

person edwin.greene    schedule 03.04.2013    source источник


Ответы (1)


Собственно, предмет обсуждения в митинге — это артефакт ралли, точно так же, как дефект, история или задача. Чтобы сделать то, что вы хотите, вам нужно создать новый артефакт Discussion (или ConversationPost в терминах rally API) и сообщить ему, с каким существующим артефактом (в вашем случае дефектом) связать себя.

rally = Rally(server, user, password)
rally.enableLogging('rallyConnection.log')
rally.setProject("RallyTestPrj")

defectID = 'DE9221'
discussion_text = "Adding discussion from Python"

# get the defect entity so we can grab the defect oid which we'll need when
# creating the new ConversationPost
defect = rally.get('Defect', query='FormattedID = %s' % defectID, instance=True)

discussion_data = {"Artifact": defect.oid, "Text": discussion_text}

# create the discussion
try:
    discussion = rally.create('ConversationPost', discussion_data)
except Exception, details:
    sys.stderr.write('ERROR: %s \n' % details)
    sys.exit(1)
print "Defect updated with a new discussion entry"
person mancdaz    schedule 05.04.2013