![](/img/trans.png)
[英]Getting error while adding watcher to JIRA ticket using JIRA python API
[英]How to add watcher to JIRA ticket using JIRA python API
我正在使用JIRA python API從我的代碼創建JIRA票證。 代碼如下所示
from jira.client import JIRA
def create_jira_issue(jira, summary, description, status):
project = getattr(settings,'jira_project_' + status)
now = datetime.datetime.now()
pm_jira_dict = {
'project': {'key': getattr(settings,'jira_project_' + status)},
'summary': summary,
'description': description,
'issuetype': {'name': settings.jira_issuetype},
'assignee':{'name': settings.jira_assignee},
'timetracking':{'originalEstimate': settings.jira_timetracking},
'duedate':now.strftime('%Y-%m-%d %H:%M:%S')
}
new_issue = jira.create_issue(fields=pm_jira_dict)
return new_issue
現在我想為此票添加一個Watcher。 我怎么能在這里添加它。
提前致謝。
假設您要添加的觀察者位於變量“觀察者”中:添加
jira.add_watcher(new_issue.id,watcher)
在代碼段的末尾。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.