Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating a work item is failing when using impersonation since 1.0.1 update #229

Closed
sirtwist opened this issue Feb 7, 2021 · 0 comments · Fixed by #240
Closed

Updating a work item is failing when using impersonation since 1.0.1 update #229

sirtwist opened this issue Feb 7, 2021 · 0 comments · Fixed by #240
Labels
bug Something isn't working fixed Bug got fixed or found a solution

Comments

@sirtwist
Copy link

sirtwist commented Feb 7, 2021

Steps to reproduce

Update a work item field with impersonation enabled (i.e. .impersonate=onBehalfOfInitiator)

A simple update ( self["Custom.CustomField"] = 10) or any other update will trigger an error.

Version 1.0.1

Expected behavior

WorkItem should be updated successfully

Actual behavior

Update fails with the message: "Remove requires Value to be null."

Diagnostic logs

Running it locally and adding some additional debug info:

[2021-02-06 16:11:35Z] [{"Method":"PATCH","Uri":"/_apis/wit/workItems/160536?bypassRules=True&suppressNotifications=False&api-version=5.0-preview.3","Headers":{"Content-Type":"application/json-patch+json"},"Body":"[{"op":5,"path":"/rev","from":null,"value":11},{"op":2,"path":"/fields/Custom.GTRMScore","from":null,"value":80},{"op":1,"path":"/fields/System.ChangedBy","from":null,"value":"George Roberts"}]"}]
[2021-02-06 16:11:35Z] [{"Code":400,"Headers":{"Content-Type":"application/json; charset=utf-8"},"Body":"{"count":1,"value":{"Message":"Remove requires Value to be null."}}"}]
[2021-02-06 16:11:35Z] Save failed: {"count":1,"value":{"Message":"Remove requires Value to be null."}}
[2021-02-06 16:11:35Z] Changes saved to Azure DevOps (mode Batch): 0 created, 1 updated.
[2021-02-06 16:11:35Z] Rule returned ''
[2021-02-06 16:11:35Z] Succeeded

First log line is the JsonPatchDocument info for the update.

Second log line is the actual response with the response code.

Environment

Happens both locally and in Azure Functions.

Version 1.0.1

@sirtwist sirtwist added the bug Something isn't working label Feb 7, 2021
giuliov added a commit that referenced this issue May 1, 2021
@giuliov giuliov added the fixed Bug got fixed or found a solution label May 1, 2021
@giuliov giuliov mentioned this issue Jun 12, 2021
giuliov added a commit that referenced this issue Jun 12, 2021
* fix typos in messages

* Squashed commit of the following:

commit 80e7206
Author: George Roberts <groberts@moddigital.net>
Date:   Mon Feb 8 10:51:21 2021 -0600

    Remove test log line

commit bf4d89d
Author: George Roberts <groberts@moddigital.net>
Date:   Sat Feb 6 23:26:55 2021 -0600

    Remove some extraneous logging

commit db994e3
Author: George Roberts <groberts@moddigital.net>
Date:   Sat Feb 6 23:16:06 2021 -0600

    Fix tests

commit c5945cd
Author: George Roberts <groberts@moddigital.net>
Date:   Sat Feb 6 22:57:14 2021 -0600

    Fix bypassrules value

commit 59f338d
Author: George Roberts <groberts@moddigital.net>
Date:   Sat Feb 6 22:54:45 2021 -0600

    Support for .bypassrules directive

* fixed an issue which caused removing work item links to fail

* Fix ".check revision false" directive disappearing on rule upload

* change log

* Add tests to check more double assignment cases

* Fixes #229 - double assignment and reset to original value

Alternative implementation to PR #236

* Fixes spurious upgrade message noted in #225

* trigger build

* Fully async

Co-authored-by: Rob Osborne <rob.osborne@capita.co.uk>
Co-authored-by: Alexander Omelchuk <AOK@foss.dk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Bug got fixed or found a solution
Projects
None yet
2 participants