tenable/integration-jira-cloud

Custom fields missing from the IssueType upon secondary runs.

Closed this issue · 7 comments

Hi

Sync was successful. I fixed several vulnerabilities of same plugin and when I run second sync I received error: body=b'{"errorMessages":["\'transition\' identifier must be an integer"],"errors":{}}'

[15:30:46] INFO     INFO:Processor:Building Task SQL Cache.                                        processor.py:152
           INFO     INFO:Processor:Building Subtask SQL Cache.                                     processor.py:158
[15:30:53] INFO     INFO:Processor:Finding related to Plugin 187315 is closed, skipping            processor.py:180
[15:30:54] ERROR    ERROR:restfly.errors.BadRequestError:[400: POST]                                   errors.py:91
                    https://adjara.atlassian.net/rest/api/3/issue/VULN-7510/transitions
                    body=b'{"errorMessages":["\'transition\' identifier must be an
                    integer"],"errors":{}}'
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/ltakashvili/test/lib/python3.12/site-packages/tenb2jira/cli.py:157 in sync                 │
│                                                                                                  │
│   154 │   │   │   │   │   │      jira_table(config)                                              │
│   155 │   │   │   │   │   │      ]))                                                             │
│   156 │   console.print(field_definition_table(processor.jira))                                  │
│ ❱ 157 │   processor.sync(cleanup=cleanup)                                                        │
│   158 │   if update:                                                                             │
│   159 │   │   with open(configfile, 'w', encoding='utf-8') as f:                                 │
│   160 │   │   │   tomlkit.dump(config, f)                                                        │
│                                                                                                  │


image
when I visit transitions endpoints
image

Do you happen to have more of the traceback in question?

Do you happen to have more of the traceback in question?

I tried to troubleshoot it by myself and eventually in turned out that I didn't have enough permissions(I dont have site-admin role anymore) to transition from "To Do" --> "Done". Even when I browse web, I couldn't do it. I gained necessary permissions on my jira side and it went smooth.

But main issue that I currently have is that, when I run sync again, I am getting this infamous error messages

image

P.S I dont receive this error messages when I delete all ticket in jira and run sync again(with removed last_run)

I only receive this error when I fix some vuln and run sync command again. which is weird.

I have correct Task and sub-task IDs in config.toml

image
image

checking task and subtask IDs in web. it seems IDs matches with config
image
image

can you run with the --debug flag set and let email me the full traceback & log? smcgrath at tenable.com

Also can you double check that the screens are configured? that error is typically a mismatch in the issuetypes, but those looks good from what you have.

can you run with the --debug flag set and let email me the full traceback & log? smcgrath at tenable.com

Also can you double check that the screens are configured? that error is typically a mismatch in the issuetypes, but those looks good from what you have.

Hi

I attached screenshots and also log files in email.

Also, very weird thing is that, during several syncs 2 subtasks were closed (which is correct, they are supposed to be closed they are fixed), but 2 is very low, there are more to be closed, but they aren't due to errors above

P.S I tested in my test jira and everything went smooth. Is it possible to have some kind of permissions issues here? because in production jira I don't have site-admin role, but have administrator role over the project.

Yeah looking into the debugs, its basically saying that none of the fields that were created are assigned to the screens associated to the subtask (10002), and that's where the failure is occurring.

If those fields ARE part of both of the screens, then it IS likely a permission issue, sadly Jira isn't very direct about what it's failing on when this happens.

Check that all of the permissions outlined here are applied to the user that is linked to the integration: https://github.com/tenable/integration-jira-cloud?tab=readme-ov-file#permissions

Looking through the log file I'm not seeing anything that points to something i can fix on my end. I'd love to be wrong and get you something working, but we need to eliminate the permission and screen problems as potential issues first.

Yeah looking into the debugs, its basically saying that none of the fields that were created are assigned to the screens associated to the subtask (10002), and that's where the failure is occurring.

If those fields ARE part of both of the screens, then it IS likely a permission issue, sadly Jira isn't very direct about what it's failing on when this happens.

Check that all of the permissions outlined here are applied to the user that is linked to the integration: https://github.com/tenable/integration-jira-cloud?tab=readme-ov-file#permissions

Looking through the log file I'm not seeing anything that points to something i can fix on my end. I'd love to be wrong and get you something working, but we need to eliminate the permission and screen problems as potential issues first.

I checked and fields are assigned to screen associated to the subtask (10002)
But checked permissions and I found out that I didn't have permissions shown in README doc (edit issue and so on). I assigned all necessary permissions and everything went smooth. I think we can close this ticket :)

Thanks a lot.

P.S I think this script should check if we have necessary permissions, if it's possible

Permissions in Jira has always been special.