Allow setting bug assignee at the same time as creating attachment via REST API

NEW
Unassigned

Status

()

bugzilla.mozilla.org
API
P2
normal
11 months ago
11 months ago

People

(Reporter: emorley, Unassigned)

Tracking

({bmo-small})

Production
bmo-small

Details

(Reporter)

Description

11 months ago
Currently it's not possible to set the assignee at the same time as creating/updating attachments when using the REST API:
https://bugzilla.readthedocs.io/en/latest/api/core/v1/attachment.html#create-attachment

Compare this to the web UI, where you can create an attachment and assign the bug in one action.

Currently this has to be done via two separate REST API calls, which results in additional bugmail.
Keywords: bmo-small
Priority: -- → P2
sketch:

around here: https://github.com/mozilla-bteam/bmo/blob/cc3141625e4c87387259c38e4ab5f56820621768/Bugzilla/WebService/Bug.pm#L926

if ($params->{takebug}) {
   $bug->set_assigned_to(Bugzilla->user);
}

should be sufficient. Testing should be done though. And it would need to be added to the docs:

https://github.com/mozilla-bteam/bmo/blob/cc3141625e4c87387259c38e4ab5f56820621768/docs/en/rst/api/core/v1/attachment.rst#create-attachment
(Reporter)

Comment 2

11 months ago
Ah so my use-case was for a tool that is performing GitHub->Bugzilla sync using the BMO REST API (bug 1351785). Such a tool wants to add attachments and set assignees with as little bugspam generated as possible.

The proposal in comment 1 would only allow setting the assignee to the tool's bot account, and not the account of the user who opened the PR.
You need to log in before you can comment on or make changes to this bug.