Where new_issue is a jira.create_issue() that I have defined earlier which works and shows on Jira within the specified project. A sample email is sent using the configuration you set up. To test the action before saving the watch, click Send test email. Jira.add_watcher(new_issue, 'mstamboulian') In the To email address field, enter one or more email addresses to whom you want to send the message when the condition is met. #jira.remove_watcher(new_issue, 'mstamboulian') Jira.assign_issue(new_issue, 'mstamboulian') #assign it to whoever you want here using their username New_issue = jira.create_issue(project='BIOD', summary='Testing!!!!', #(projects where we get the biodesk tickets assigned to)
#for now the project ID I want to create an issue is BIOD #creating a jira issue in a specific project Jira = JIRA(options, basic_auth=(user,apikey) ) I cannot figure out what im doing wrong, Im just invoking the following line and its throwing it off: """ ~/programs/anaconda3/lib/python3.7/site-packages/jira/resilientsession.py in raise_on_error(r, verb, **kwargs) > 189 raise_on_error(response, verb=verb, **kwargs)ġ90 # after raise_on_error, only Response objects are allowed throughġ91 response = cast(Response, response) # tell mypy only Response-like are here
~/programs/anaconda3/lib/python3.7/site-packages/jira/resilientsession.py in _verb(self, verb, url, retry_data, **kwargs) > 198 return self._verb("POST", str(url), data=data, json=json, **kwargs)Ģ00 def put(self, url: Union, data=None, **kwargs) -> Response: # type: ignore > 2167 return self._session.post(url, data=json.dumps(watcher))Ģ169 in post(self, url, data, json, **kwargs)ġ97 def post(self, url: Union, data=None, json=None, **kwargs) -> Response: # type: ignore ~/programs/anaconda3/lib/python3.7/site-packages/jira/client.py in add_watcher(self, issue, watcher)Ģ166 url = self._get_url("issue/" + str(issue) + "/watchers") > 119 result = func(*arg_list, **kwargs) ~/programs/anaconda3/lib/python3.7/site-packages/jira/client.py in wrapper(*args, **kwargs) > 40 jira.add_watcher(new_issue, 'jhutchins') JIRAError Traceback (most recent call last)ģ8 jira.assign_issue(new_issue, 'mstamboulian')ģ9 #jira.remove_watcher(new_issue, 'mstamboulian')
And then I add a user to the 'My Projects Assignees' group. However when I do that im getting the following error - Edit: this is still true, after I add myself to 'restricted group', see Alex.V's answer to this question So I deleted the group 'restricted group' and tried to work with 'assignees': 3) I choose an issue and set its visibility to 'My Project Assignees'. Im using the following section of the documentation to follow: If just a single name, the JSON output is just "name1", but for multiple names in an array, it becomes (the square brackets is what throws it off apparently).Im following the simple steps fro Jira ticketing documentation to add watchers to an existing issue that I created. For some reason the API won't accept properly formatted JSON calls with multiple names. So the only way I could get around this is to just make multiple API calls to add the watchers. Is there a way of adding multiple watchers to an existing issue? I tried doing it this way: $data = array( However, this method only allows me to add one watcher. Using PHP and the JIRA REST API, I can add watchers to existing issues via this code: $username = 'xxxx' Ĭurl_setopt($ch, CURLOPT_RETURNTRANSFER, true) Ĭurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0) Ĭurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0) Ĭurl_setopt($ch, CURLOPT_HTTPHEADER, $headers) Ĭurl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST") Ĭurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)) Ĭurl_setopt($ch, CURLOPT_USERPWD, "$username:$password")