简体   繁体   English

JIRA:使用python-jira lib更新sprint状态

[英]JIRA: Update sprint status using python-jira lib

Im' try to create a periodic task that close a print and launch the next. 我会尝试创建一个定期任务,以关闭打印并启动下一个打印。

What I'm planning to do is to find the current Sprint ("state":"ACTIVE") and update its state to ("state":"CLOSED") and take the next Sprint and update it from FUTURE to ACTIVE in a bi-weekly basis. 我打算做的是找到当前的Sprint(“ state”:“ ACTIVE”)并将其状态更新为(“ state”:“ CLOSED”),然后进行下一个Sprint并将其从FUTURE更新为ACTIVE每两周一次。

I can see in the library that we can not update the state of a sprint (this part is commented by default): 我可以在库中看到我们无法更新sprint的状态(默认情况下此部分已注释):

def update_sprint(self, id, name=None, startDate=None, endDate=None):
    payload = {}
    if name:
        payload['name'] = name
    if startDate:
        payload['startDate'] = startDate
    if endDate:
        payload['startDate'] = endDate
    # if state:
    #    payload['state']=state

    url = self._get_url('sprint/%s' % id, base=self.AGILE_BASE_URL)
    r = self._session.put(
        url, data=json.dumps(payload))

    return json_loads(r)

My questions is: 我的问题是:

Is there a reason for this? 是否有一个原因?

How can I perform this operation in another way ? 如何以其他方式执行此操作?

Thanks! 谢谢!

Update 更新资料

I raised a bug and it has been fixed: https://github.com/pycontribs/jira/issues/123 我提出了一个错误,该错误已得到修复: https : //github.com/pycontribs/jira/issues/123

Hope this will help 希望这会有所帮助

I'm not really sure how you are updating your values but the way I have been updating values is: 我不确定您如何更新值,但是我一直在更新值的方式是:

    issue.update(status={'name': 'Closed'})

Source: http://pythonhosted.org/jira/ 资料来源: http : //pythonhosted.org/jira/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM