ljay79 / jira-tools

Project Aid for Jira - Google Spreadsheet Add-on for Jira Integration
GNU General Public License v3.0
112 stars 46 forks source link

Update Jira Issues: Supported custom fields - Type Labels #173

Open ljay79 opened 5 years ago

ljay79 commented 5 years ago

New feature "Update Jira Issues" does fail on certain jira fields due to their expected format transmitted to the API during IssueUpdate.

Custom field: cField Labels

Jira Field Type: Labels (array of strings)

Error:

cField Labels: data was not an array, {"errorMessages":["Number value expected as the Sprint id."],"errors":{"customfield_11121":"data was not an array"}}

paul-lemon commented 5 years ago

I can't reproduce this. This is the schema for the custom field in our Server side JIRA for labels

{schema={custom=com.atlassian.jira.plugin.system.customfieldtypes:labels, type=array, items=string, customId=17094
    }, navigable=true, orderable=true, custom=true, name=Projects Affected, clauseNames=[cf[
        17094
      ], Projects Affected
    ], id=customfield_17094, searchable=true
  },

I am able to set a single label, add multiple labels and delete labels.. This is the log from Stackdriver showing the payload when updating an issue. fetchArgs: {payload={"update":{"comment":[{"add":{"body":"Updated by [Project Aid for Jira|https://github.com/ljay79/jira-tools]"}}]},"fields":{"labels":["test","two"]}}}

We should disable Sprints updating (which shows in your message above). Its still to buggy with the need for an integer ID.

paul-lemon commented 5 years ago

Could you share the schema from your server instance? Could you find the payload in the logging as well?

ljay79 commented 5 years ago

Find attached the fiel schema of my used Jira Cloud Instance.

jira-field-schema.txt

ljay79 commented 5 years ago

As the add-on is now published since early morning, i have used a individual google account with the production live add-on. Was able to reproduce the issue.

Notes:

cfield labels - update error 01

fetchArgs: {
    payload = {
        "update": {
            "comment": [{
                "add": {
                    "body": "Updated by [Project Aid for Jira|https://github.com/ljay79/jira-tools]"
                }
            }]
        },
        "fields": {
            "customfield_11121": "test_label2"
        }
    }
}

httpResponse: {"errorMessages":[],"errors":{"customfield_11121":"data was not an array"}}

paul-lemon commented 5 years ago

Thanks for this - I will test.

paul-lemon commented 5 years ago

I can reproduce locally and will work on this later this evening.

paul-lemon commented 5 years ago

It only occurs when using a custom "label" field rather than the built in Jira Label field.

ljay79 commented 5 years ago

Thats correct. Only on custom "label" field.

paul-lemon commented 5 years ago

Should have a fix soon - shall I start 1.2.1 branch for fixes?

ljay79 commented 5 years ago

sure

ljay79 commented 5 years ago

@paul-lemon he man, are you still working on this project?

sandun0402 commented 3 years ago

@paul-lemon same issue pressing to me, could you please provide a solution for this? image