Skip to content

[BUG]: Mutation UpdateProjectV2ItemFieldValue fails with ProjectV2FieldValue has the wrong arguments error #292

@CodyALohse

Description

@CodyALohse

What happened?

When performing an UpdateProjectV2ItemFieldValue mutation the response returns with a ProjectV2FieldValue has the wrong arguments error

var updateStatusQuery = new Mutation().UpdateProjectV2ItemFieldValue(
	new UpdateProjectV2ItemFieldValueInput {
		FieldId = new ID("xxxxxxx_xxxxxxx-xxxxxxxxxxxx"),
		ItemId = new ID("xxxxxx_xxxxxxxxx-xxxxxxxxxxxx"),
		ProjectId = new ID("xxx_xxxxxxx-xxxxxxx"),
		ClientMutationId = "abc123",
		Value = new ProjectV2FieldValue {
			SingleSelectOptionId = "8499aa9c" 
		}
	})
	.Select(p => p.ProjectV2Item.Id);
	
var updateStatusRes = await connection.Run(updateStatusQuery);

Below is the generated query:

{ "query":"mutation {
    updateProjectV2ItemFieldValue(input:{
        projectId:\"xxx_xxxxxxx-xxxxxxxs\",
        itemId:\"xxxxxx_xxxxxxxxx-xxxxxxxxxxxx\",
        fieldId:\"xxxxxxx_xxxxxxx-xxxxxxxxxxxx\",
        value:{
            text:null,
            number:null,
            date:null,
            singleSelectOptionId:\"8499aa9c\",
            iterationId:null }
        ,clientMutationId:\"abc123\"})
        {projectV2Item{id}}}","variables":null}

It appears that the value object ProjectV2FieldValue cannot be passed with more than one property per request. Performing a request without the additional null properties does succeed:

{ "query":"mutation {
    updateProjectV2ItemFieldValue(input:{
        projectId:\"xxx_xxxxxxx-xxxxxxxs\",
        itemId:\"xxxxxx_xxxxxxxxx-xxxxxxxxxxxx\",
        fieldId:\"xxxxxxx_xxxxxxx-xxxxxxxxxxxx\",
        value:{
            singleSelectOptionId:\"8499aa9c\",
         }
        ,clientMutationId:\"abc123\"})
        {projectV2Item{id}}}","variables":null}

Thanks

Versions

v0.2.0-beta

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Up for grabsIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documentedhacktoberfestIssues for participation in Hacktoberfest

    Type

    No type

    Projects

    Status

    🔥 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions