marc0l92 / obsidian-jira-issue

This plugin allows you to track the progress of Atlassian Jira issues from your Obsidian notes.
https://marc0l92.github.io/obsidian-jira-issue/
GNU Affero General Public License v3.0
234 stars 36 forks source link

JIRA non standard column (custom fields) inserted using the $ symbol are displayed as [object] #19

Open dooderino opened 2 years ago

dooderino commented 2 years ago

We have a custom field called Risk Level and when creating a query there is an auto-completion option called $Risk Level. When using it in the query, it is displayed in the column as [object].

marc0l92 commented 2 years ago

Hello, in the last version of the plugin I added a new option in the settings to display additional debug information. Could you update the plugin to the last version, enable the debug mode in the plugin settings, open the console with Ctrl+Shift+i and check what is the response you get from Jira?

As soon as the option is enabled the plugin will perform a request to download all the existing custom fields and custom functions: image Take the response of the fields request and check if you have inside the "Risk Level"

It should look something like this: image

If it is not an issue for you, can you send me the JSON related to this field? or tell me if there is something strange you see compared to the other custom fields that works?

jwthomp commented 2 years ago

I am getting the [object] output for a custom field named $Product

This is the schema data that I see:

{
    "id": "customfield_13056",
    "key": "customfield_13056",
    "name": "Product",
    "untranslatedName": "Product",
    "custom": true,
    "orderable": true,
    "navigable": true,
    "searchable": true,
    "clauseNames": ["cf[13056]", "Product", "Product[Dropdown]"],
    "schema": {
        "type": "option",
        "custom": "com.atlassian.jira.plugin.system.customfieldtypes:select",
        "customId": 13056
    }
},

In the response text, I see the following for what the product should display:

"customfield_13056": {
                "self": "https://xxx.atlassian.net/rest/api/2/customFieldOption/11080",
                "value": "A Product Name",
                "id": "11080"
            },```

After seeing the schema, I also tried

Please let me know if I can provide other information to help diagnose. I'm happy to try anything as well.

marc0l92 commented 2 years ago

In the first comment the custom field was $Risk Level and now you are talking about $Product. I'm a bit confused. Are they the same field? or do they have the same issue?

Are you able to see $Product in the auto-completion ?

marc0l92 commented 2 years ago

As you can see the content of $Product is actually an object. This usually happen when the field is handled by a Jira plugin. What would you like to see in the column of $Product when the field content is:

"customfield_13056": {
  "self": "https://xxx.atlassian.net/rest/api/2/customFieldOption/11080",
  "value": "A Product Name",
  "id": "11080"
}

Do you know what is the plugin that handle this custom field?

dooderino commented 2 years ago

In the first comment the custom field was $Risk Level and now you are talking about $Product. I'm a bit confused. Are they the same field? or do they have the same issue?

Are you able to see $Product in the auto-completion ?

Risk Level was mine, Jeff is another user hitting the same issue but with a different custom field.

marc0l92 commented 2 years ago

Hahaha sorry, I assumed that I was talking always with the same person. @dooderino , did you manage to find the issue? Or can you give me some additional information like @jwthomp did?

marc0l92 commented 2 years ago

Hello @dooderino @jwthomp ,

you should be able to see some improvements, if you update the plugin to version 1.25.0.

Let me know if it is enough

igorpereirabr1 commented 1 year ago

Hi, first of all, congratulations on this great plugin! I have the same issue mentioned here, in my case the object "Sprint" looks like this:

[{"id":2314,"name":"PDET PI 22.4 Sprint 1","state":"future","boardId":586,"goal":"","startDate":"2022-10-17T04:00:00.000Z","endDate":"2022-10-31T04:00:00.000Z"}] --

I would like to get the object fields individually, like: Sprint.name

Is this planned to the next releases?

Thanks!

BaronPellatarte commented 1 year ago

Hello @marc0l92 ,

If it can help, here is another log. This is the display of a custom field :

{"self":"https://mycompanyserver.com/csbugtrack/rest/api/2/customFieldOption/10003","value":"PROD","id":"10003","disabled":false}

and here is the the response from the debug log :

\"customfield_10000\":{\"self\":\"https://mycompanyserver.com/csbugtrack/rest/api/2/customFieldOption/10003\",\"value\":\"PROD\",\"id\":\"10003\",\"disabled\":false}

the entire object is shown in the result render instead of the value. Maybe I missed something as I've got the version 1.31 and you were talking about improvements in the 1.25

thank you for this wonderful plugin!

jbaughman42 commented 1 year ago

If it helps, I use a lot of custom fields, and the problem seems to be related to drop-down fields that have values. Custom date fields display appropriately, as do custom Boolean fields and custom text fields.

BungaRazvan commented 3 weeks ago

i have the same problem where my organization has a custom field that's a list of objects.


[ { "id": 4860, "name": "SPRINT  2024.3 Iteration 3", "state": "closed", "boardId": 229, "goal": "GOAL #1.", "startDate": "2024-07-19T10:32:25.148Z", "endDate": "2024-08-02T16:30:00.000Z", "completeDate": "2024-08-02T09:56:28.506Z" } ]```
BungaRazvan commented 3 weeks ago

I think if you could use jsonpath as you can with the notes it would solve most of the issues and provide quite a flexible solution for other people as well.

BungaRazvan commented 2 weeks ago

here's a PR with what i was thinking looking forward for feedback.