REST API: Allow created_at when SUDO is specified
I'm working on importing tickets into Gitlab using the Gitlab REST API. I'd like to be able to perserve the original author of the issue and the original time the issue was submitted. It seems that Gitlab does not honor the Issue or Note REST created_at
field when a SUDO
user is specified. I've tried specifying the user using the sudo
parameter and the SUDO
header.
Below are two commands that I'm using to test with. Here the http
command is httpie (https://github.com/jkbrzt/httpie).
Create an issue at a specific time without sudo-ing. This call works as expected and the resulting issue has the specified submission date/time.
http --json POST http://192.168.100.12/api/v3/projects/root%2fproject/issues private_token=MY_TOKEN title="Test Issue With Time" created_at="2016-03-11T03:45:40Z"
Attempt to create an issue at a specific time while sudo-ing to a specific user. This call will create an issue and make the submitter the specified user (6). But, the submission time will be now instead of the one I specified in created_at
:
http --json POST http://192.168.100.12/api/v3/projects/root%2fproject/issues private_token=MY_TOKEN title="Test Issue With Time" created_at="2016-03-11T03:45:40Z" sudo=6