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

Jira Cloud initial setup fails - Custom field cannot be set. It is not on the appropriate screen, or unknown. #108

Closed
ghost opened this issue Mar 30, 2021 · 8 comments

Comments

@ghost
Copy link

ghost commented Mar 30, 2021

Running into a weird issue, where the initial Jira Cloud project's config fails.
It seems to be due to (recent?) changes in Jira Cloud UI.
Auth is good, Project/Key are good.

Below is the debug log extract using --troubleshoot option.
Have shortened it to where the Jira POST exception is raised, as everything prior is working like a charm.

2021-03-30 13:17:26,137 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/issue?update_history=False HTTP/1.1" 400 None
2021-03-30 13:17:26,138 restfly.errors.BadRequestError ERROR [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":[],"errors":{"summary":"Field \'summary\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13151":"Field \'customfield_13151\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13150":"Field \'customfield_13150\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13142":"Field \'customfield_13142\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13144":"Field \'customfield_13144\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13143":"Field \'customfield_13143\' cannot be set. It is not on the appropriate screen, or unknown.","description":"Field \'description\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13146":"Field \'customfield_13146\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13145":"Field \'customfield_13145\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13148":"Field \'customfield_13148\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13147":"Field \'customfield_13147\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13169":"Field \'customfield_13169\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13149":"Field \'customfield_13149\' cannot be set. It is not on the appropriate screen, or unknown."}}'
2021-03-30 13:17:26,138 root ERROR Caught the following Exception
Traceback (most recent call last):
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/transform.py", line 378, in _process_open_vuln
    i = self._jira.issues.upsert(fields=issue, jql=' and '.join(jql))
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/jira/issues.py", line 48, in upsert
    issue = self.create(**kwargs)
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/jira/issues.py", line 18, in create
    return self._api.post('issue',
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/restfly/session.py", line 563, in post
    return self._request('POST', path, **kwargs)
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/restfly/session.py", line 477, in _request
    raise err(resp, retries=retries, func=self._error_func)
restfly.errors.BadRequestError: [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":[],"errors":{"summary":"Field \'summary\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13151":"Field \'customfield_13151\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13150":"Field \'customfield_13150\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13142":"Field \'customfield_13142\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13144":"Field \'customfield_13144\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13143":"Field \'customfield_13143\' cannot be set. It is not on the appropriate screen, or unknown.","description":"Field \'description\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13146":"Field \'customfield_13146\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13145":"Field \'customfield_13145\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13148":"Field \'customfield_13148\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13147":"Field \'customfield_13147\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13169":"Field \'customfield_13169\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13149":"Field \'customfield_13149\' cannot be set. It is not on the appropriate screen, or unknown."}}'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/cli.py", line 153, in cli
    ingest.ingest(int(observed_since), first_discovery)
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/transform.py", line 650, in ingest
    self.create_issues(vulns)
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/transform.py", line 498, in create_issues
    self._process_open_vuln(v, fid)
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/transform.py", line 381, in _process_open_vuln
    sys.exit(2)
SystemExit: 2

### Available IssueTypes
11: Sub-task
3: Task
11222: Task
11210: Subtask
11208: Task
11220: Subtask
11218: Task
11224: Subtask

I did try searching for the Jira Screen IDs but no luck.
Anybody else having this behaviour ?

Looks to me like Jira Cloud did again change their UI / API endpoints and the integration is not capable of dealing with it.

@SteveMcGrath
Copy link
Collaborator

SteveMcGrath commented Mar 31, 2021

can you post the whole debug output? If that's non-ideal, then please email it to smcgrath at tenable.com

@ghost
Copy link
Author

ghost commented Mar 31, 2021

Here it is:

$ Tenable-jira config.yaml --setup-only --troubleshoot

### Configuration File:
jira:
  address: <REDACTED>
  api_token: <REDACTED>
  api_username: <REDACTED>
log:
  filename: /tmp/logfile_debug.log
  format: '%(asctime)-15s %(name)s %(levelname)s %(message)s'
  level: 10
project:
  leadAccountId: <REDACTED>
service:
  interval: 0
tenable:
  access_key: <REDACTED>
  secret_key: <REDACTED>


### Debug Logs
2021-03-30 13:17:12,020 root INFO Tenable2JiraCloud Version 1.1.22
2021-03-30 13:17:12,021 root INFO Using configuration file config.yaml
2021-03-30 13:17:12,021 root INFO Running on Python 3.8.2 Darwin/x86_64
2021-03-30 13:17:12,022 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/session", "params": {}, "body": {}}
2021-03-30 13:17:12,033 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): cloud.tenable.com:443
2021-03-30 13:17:12,428 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /session HTTP/1.1" 200 None
2021-03-30 13:17:12,431 tenable.io.TenableIO DEBUG Request-UUID c2f223d9a603aaa76f9e6fb14fa7fe76 for https://cloud.tenable.com/session
2021-03-30 13:17:12,432 tenable_jira.jira.Jira DEBUG Request:{"method": "GET", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/project/VULN", "params": {}, "body": {}}
2021-03-30 13:17:12,435 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): <JIRA_CLOUD_HOST>:443
2021-03-30 13:17:12,656 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/project/VULN HTTP/1.1" 200 None
2021-03-30 13:17:12,659 tenable_jira.jira.Jira DEBUG Request:{"method": "GET", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {}}
2021-03-30 13:17:12,824 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/field HTTP/1.1" 200 None
2021-03-30 13:17:12,829 tenable_jira.jira.Jira INFO Tenable Platform is customfield_13141 (existing)
2021-03-30 13:17:12,829 tenable_jira.jira.Jira INFO CVEs is customfield_13142 (existing)
2021-03-30 13:17:12,830 tenable_jira.jira.Jira INFO CVSSv2 Base Score is customfield_13143 (existing)
2021-03-30 13:17:12,830 tenable_jira.jira.Jira INFO CVSSv2 Temporal Score is customfield_13144 (existing)
2021-03-30 13:17:12,830 tenable_jira.jira.Jira INFO CVSSv3 Base Score is customfield_13145 (existing)
2021-03-30 13:17:12,830 tenable_jira.jira.Jira INFO CVSSv3 Temporal Score is customfield_13146 (existing)
2021-03-30 13:17:12,830 tenable_jira.jira.Jira INFO Patch Publication Date is customfield_13147 (existing)
2021-03-30 13:17:12,830 tenable_jira.jira.Jira INFO Tenable Plugin ID is customfield_13148 (existing)
2021-03-30 13:17:12,830 tenable_jira.jira.Jira INFO Tenable Plugin Family is customfield_13149 (existing)
2021-03-30 13:17:12,830 tenable_jira.jira.Jira INFO Tenable Plugin Name is customfield_13150 (existing)
2021-03-30 13:17:12,831 tenable_jira.jira.Jira INFO Vulnerability Severity is customfield_13151 (existing)
2021-03-30 13:17:12,831 tenable_jira.jira.Jira INFO Tenable Asset UUID is customfield_13152 (existing)
2021-03-30 13:17:12,831 tenable_jira.jira.Jira INFO Tenable Asset Tags is customfield_13153 (existing)
2021-03-30 13:17:12,831 tenable_jira.jira.Jira INFO Device MAC Addresses is customfield_13154 (existing)
2021-03-30 13:17:12,831 tenable_jira.jira.Jira INFO Device IPv4 Addresses is customfield_13155 (existing)
2021-03-30 13:17:12,831 tenable_jira.jira.Jira INFO Device IPv6 Addresses is customfield_13156 (existing)
2021-03-30 13:17:12,831 tenable_jira.jira.Jira INFO Device Hostname is customfield_13157 (existing)
2021-03-30 13:17:12,831 tenable_jira.jira.Jira INFO Device NetBIOS Name is customfield_13158 (existing)
2021-03-30 13:17:12,831 tenable_jira.jira.Jira INFO Device DNS Name is customfield_13159 (existing)
2021-03-30 13:17:12,831 tenable_jira.jira.Jira INFO Device Network ID is customfield_13160 (existing)
2021-03-30 13:17:12,832 tenable_jira.jira.Jira INFO Vulnerability First Seen is customfield_13161 (existing)
2021-03-30 13:17:12,832 tenable_jira.jira.Jira INFO Vulnerability Last Seen is customfield_13162 (existing)
2021-03-30 13:17:12,832 tenable_jira.jira.Jira INFO Vulnerability Last Fixed is customfield_13163 (existing)
2021-03-30 13:17:12,832 tenable_jira.jira.Jira INFO Vulnerability State is customfield_13164 (existing)
2021-03-30 13:17:12,832 tenable_jira.jira.Jira INFO Vulnerability Port is customfield_13165 (existing)
2021-03-30 13:17:12,832 tenable_jira.jira.Jira INFO Vulnerability Protocol is customfield_13166 (existing)
2021-03-30 13:17:12,832 tenable_jira.jira.Jira INFO Vulnerability Repository ID is customfield_13167 (existing)
2021-03-30 13:17:12,832 tenable_jira.jira.Jira INFO Vulnerability Repository Name is customfield_13168 (existing)
2021-03-30 13:17:12,832 tenable_jira.jira.Jira INFO Tenable VPR Score is customfield_13169 (existing)
2021-03-30 13:17:12,833 tenable_jira.jira.Jira DEBUG Request:{"method": "GET", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/issuetype", "params": {}, "body": {}}
2021-03-30 13:17:12,974 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/issuetype HTTP/1.1" 200 None
2021-03-30 13:17:12,977 tenable_jira.jira.Jira DEBUG Request:{"method": "GET", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/screens", "params": {"startAt": -100, "maxResults": 100}, "body": {}}
2021-03-30 13:17:13,066 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens?startAt=-100&maxResults=100 HTTP/1.1" 200 None
2021-03-30 13:17:13,068 tenable_jira.transform.Tio2Jira INFO Using JIRA Screens []
2021-03-30 13:17:13,068 tenable.io.TenableIO DEBUG {"method": "POST", "url": "https://cloud.tenable.com/assets/export", "params": {}, "body": {"filters": {"updated_at": 1614499200}, "chunk_size": 1000}}
2021-03-30 13:17:13,516 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "POST /assets/export HTTP/1.1" 200 None
2021-03-30 13:17:13,518 tenable.io.TenableIO DEBUG Request-UUID 486a22a2f2f2fdb387157185ff21816a for https://cloud.tenable.com/assets/export
2021-03-30 13:17:13,518 tenable.io.TenableIO DEBUG Initiated asset export a751ebb6-14d0-4bbd-860f-f6f3472e4bb5
2021-03-30 13:17:13,518 tenable.io.TenableIO DEBUG {"method": "POST", "url": "https://cloud.tenable.com/assets/export", "params": {}, "body": {"filters": {"deleted_at": 1614499200}, "chunk_size": 1000}}
2021-03-30 13:17:14,516 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "POST /assets/export HTTP/1.1" 200 None
2021-03-30 13:17:14,519 tenable.io.TenableIO DEBUG Request-UUID ebab9f15f5c0313c66e23f3e76b42d31 for https://cloud.tenable.com/assets/export
2021-03-30 13:17:14,520 tenable.io.TenableIO DEBUG Initiated asset export 0569c8fd-bc67-407c-b296-0684889f2c9c
2021-03-30 13:17:14,520 tenable.io.TenableIO DEBUG {"method": "POST", "url": "https://cloud.tenable.com/assets/export", "params": {}, "body": {"filters": {"terminated_at": 1614499200}, "chunk_size": 1000}}
2021-03-30 13:17:15,704 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "POST /assets/export HTTP/1.1" 200 None
2021-03-30 13:17:15,706 tenable.io.TenableIO DEBUG Request-UUID 424322e2e147f073f74a1878d81b8a08 for https://cloud.tenable.com/assets/export
2021-03-30 13:17:15,707 tenable.io.TenableIO DEBUG Initiated asset export 340b2cb2-06a6-473b-8efa-5438dcd800bb
2021-03-30 13:17:15,707 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/assets/export/340b2cb2-06a6-473b-8efa-5438dcd800bb/status", "params": {}, "body": {}}
2021-03-30 13:17:16,887 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /assets/export/340b2cb2-06a6-473b-8efa-5438dcd800bb/status HTTP/1.1" 200 None
2021-03-30 13:17:16,888 tenable.io.TenableIO DEBUG Request-UUID b8122649a3e39f38050851a7e5a55164 for https://cloud.tenable.com/assets/export/340b2cb2-06a6-473b-8efa-5438dcd800bb/status
2021-03-30 13:17:16,889 tenable.io.exports.ExportsIterator DEBUG EXPORT assets 340b2cb2-06a6-473b-8efa-5438dcd800bb is status FINISHED
2021-03-30 13:17:16,889 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/assets/export/0569c8fd-bc67-407c-b296-0684889f2c9c/status", "params": {}, "body": {}}
2021-03-30 13:17:18,126 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /assets/export/0569c8fd-bc67-407c-b296-0684889f2c9c/status HTTP/1.1" 200 None
2021-03-30 13:17:18,128 tenable.io.TenableIO DEBUG Request-UUID b6157a7676b547133eecc4ce2c03de98 for https://cloud.tenable.com/assets/export/0569c8fd-bc67-407c-b296-0684889f2c9c/status
2021-03-30 13:17:18,128 tenable.io.exports.ExportsIterator DEBUG EXPORT assets 0569c8fd-bc67-407c-b296-0684889f2c9c is status FINISHED
2021-03-30 13:17:18,129 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/assets/export/a751ebb6-14d0-4bbd-860f-f6f3472e4bb5/status", "params": {}, "body": {}}
2021-03-30 13:17:19,430 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /assets/export/a751ebb6-14d0-4bbd-860f-f6f3472e4bb5/status HTTP/1.1" 200 None
2021-03-30 13:17:19,432 tenable.io.TenableIO DEBUG Request-UUID 68d915aeb8950cbc033cbd073a8d8645 for https://cloud.tenable.com/assets/export/a751ebb6-14d0-4bbd-860f-f6f3472e4bb5/status
2021-03-30 13:17:19,432 tenable.io.exports.ExportsIterator DEBUG EXPORT assets a751ebb6-14d0-4bbd-860f-f6f3472e4bb5 is status FINISHED
2021-03-30 13:17:19,432 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/assets/export/a751ebb6-14d0-4bbd-860f-f6f3472e4bb5/chunks/1", "params": {}, "body": {}}
2021-03-30 13:17:20,735 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /assets/export/a751ebb6-14d0-4bbd-860f-f6f3472e4bb5/chunks/1 HTTP/1.1" 200 None
2021-03-30 13:17:20,736 tenable.io.TenableIO DEBUG Request-UUID 2acf02f0c2c1615bf530c6080ef4a4b2 for https://cloud.tenable.com/assets/export/a751ebb6-14d0-4bbd-860f-f6f3472e4bb5/chunks/1
2021-03-30 13:17:20,736 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/assets/export/a751ebb6-14d0-4bbd-860f-f6f3472e4bb5/status", "params": {}, "body": {}}
2021-03-30 13:17:21,829 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /assets/export/a751ebb6-14d0-4bbd-860f-f6f3472e4bb5/status HTTP/1.1" 200 None
2021-03-30 13:17:21,832 tenable.io.TenableIO DEBUG Request-UUID 8b12bcafb0f54f1946ec010cfaa16266 for https://cloud.tenable.com/assets/export/a751ebb6-14d0-4bbd-860f-f6f3472e4bb5/status
2021-03-30 13:17:21,832 tenable.io.exports.ExportsIterator DEBUG EXPORT assets a751ebb6-14d0-4bbd-860f-f6f3472e4bb5 is status FINISHED
2021-03-30 13:17:21,832 tenable.io.TenableIO DEBUG since=None
2021-03-30 13:17:21,832 tenable.io.TenableIO DEBUG first_found=None
2021-03-30 13:17:21,832 tenable.io.TenableIO DEBUG last_found=1614499200
2021-03-30 13:17:21,833 tenable.io.TenableIO DEBUG last_fixed=None
2021-03-30 13:17:21,833 tenable.io.TenableIO DEBUG first_scan_time=None
2021-03-30 13:17:21,833 tenable.io.TenableIO DEBUG last_authenticated_scan_time=None
2021-03-30 13:17:21,833 tenable.io.TenableIO DEBUG last_assessed=None
2021-03-30 13:17:21,833 tenable.io.TenableIO DEBUG {"method": "POST", "url": "https://cloud.tenable.com/vulns/export", "params": {}, "body": {"filters": {"last_found": 1614499200, "severity": ["high", "critical"]}, "num_assets": "1000", "include_unlicensed": true}}
2021-03-30 13:17:23,109 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "POST /vulns/export HTTP/1.1" 200 None
2021-03-30 13:17:23,111 tenable.io.TenableIO DEBUG Request-UUID 7e1ba0fcfbb8d725ed986722cb505d86 for https://cloud.tenable.com/vulns/export
2021-03-30 13:17:23,111 tenable.io.TenableIO DEBUG Initiated vuln export 3e941859-eea5-4c10-9a93-f13be228783e
2021-03-30 13:17:23,112 tenable_jira.transform.Tio2Jira INFO Updating and creating issues marked as Open
2021-03-30 13:17:23,112 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/3e941859-eea5-4c10-9a93-f13be228783e/status", "params": {}, "body": {}}
2021-03-30 13:17:24,245 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/3e941859-eea5-4c10-9a93-f13be228783e/status HTTP/1.1" 200 None
2021-03-30 13:17:24,247 tenable.io.TenableIO DEBUG Request-UUID d9a9fdadbcc0a340f79ae6a82d7310a4 for https://cloud.tenable.com/vulns/export/3e941859-eea5-4c10-9a93-f13be228783e/status
2021-03-30 13:17:24,248 tenable.io.exports.ExportsIterator DEBUG EXPORT vulns 3e941859-eea5-4c10-9a93-f13be228783e is status FINISHED
2021-03-30 13:17:24,248 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/3e941859-eea5-4c10-9a93-f13be228783e/chunks/1", "params": {}, "body": {}}
2021-03-30 13:17:25,655 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/3e941859-eea5-4c10-9a93-f13be228783e/chunks/1 HTTP/1.1" 200 42281
2021-03-30 13:17:25,777 tenable.io.TenableIO DEBUG Request-UUID bb252155d19e92a6337cea40fff55ff1 for https://cloud.tenable.com/vulns/export/3e941859-eea5-4c10-9a93-f13be228783e/chunks/1
2021-03-30 13:17:25,785 tenable_jira.jira.Jira DEBUG Request:{"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/search", "params": {}, "body": {"jql": "project = \"VULN\" and issuetype = \"Task\" and status not in (Closed, Done, Resolved) and \"Tenable Plugin ID\" ~ \"144875\""}}
2021-03-30 13:17:25,968 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/search HTTP/1.1" 200 None
2021-03-30 13:17:25,970 tenable_jira.jira.Jira DEBUG Request:{"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/issue", "params": {"update_history": false}, "body": {"fields": {"project": {"key": "VULN"}, "issuetype": {"id": "3"}, "customfield_13142": ["CVE-2021-1716", "CVE-2021-1715"], "customfield_13143": "9.3", "customfield_13144": "6.9", "customfield_13145": "7.8", "customfield_13146": "6.8", "customfield_13147": "2021-01-12T00:00:00Z", "customfield_13148": "144875", "customfield_13149": "Windows : Microsoft Bulletins", "customfield_13150": "Security Updates for Microsoft Word Products (January 2021)", "customfield_13151": "High", "customfield_13169": "6.7", "summary": "[144875] Security Updates for Microsoft Word Products (January 2021)", "description": {"version": 1, "type": "doc", "content": [{"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Description"}]}, {"type": "paragraph", "content": [{"type": "text", "text": "The Microsoft Word Products are missing security updates. It\nis, therefore, affected by multiple vulnerabilities:\n\n  - A remote code execution vulnerability. An attacker can\n    exploit this to bypass authentication and execute\n    unauthorized arbitrary commands. (CVE-2021-1715,\n    CVE-2021-1716)"}]}, {"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Solution"}]}, {"type": "paragraph", "content": [{"type": "text", "text": "Microsoft has released the following security updates to address this issue:  \n  -KB4486764\n  -KB4493156\n  -KB4493145\n\nFor Office 365, Office 2016 C2R, or Office 2019, ensure automatic\nupdates are enabled or open any office app and manually perform an\nupdate."}]}]}}}}
2021-03-30 13:17:26,137 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/issue?update_history=False HTTP/1.1" 400 None
2021-03-30 13:17:26,138 restfly.errors.BadRequestError ERROR [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":[],"errors":{"summary":"Field \'summary\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13151":"Field \'customfield_13151\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13150":"Field \'customfield_13150\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13142":"Field \'customfield_13142\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13144":"Field \'customfield_13144\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13143":"Field \'customfield_13143\' cannot be set. It is not on the appropriate screen, or unknown.","description":"Field \'description\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13146":"Field \'customfield_13146\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13145":"Field \'customfield_13145\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13148":"Field \'customfield_13148\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13147":"Field \'customfield_13147\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13169":"Field \'customfield_13169\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13149":"Field \'customfield_13149\' cannot be set. It is not on the appropriate screen, or unknown."}}'
2021-03-30 13:17:26,138 root ERROR Caught the following Exception
Traceback (most recent call last):
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/transform.py", line 378, in _process_open_vuln
    i = self._jira.issues.upsert(fields=issue, jql=' and '.join(jql))
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/jira/issues.py", line 48, in upsert
    issue = self.create(**kwargs)
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/jira/issues.py", line 18, in create
    return self._api.post('issue',
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/restfly/session.py", line 563, in post
    return self._request('POST', path, **kwargs)
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/restfly/session.py", line 477, in _request
    raise err(resp, retries=retries, func=self._error_func)
restfly.errors.BadRequestError: [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":[],"errors":{"summary":"Field \'summary\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13151":"Field \'customfield_13151\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13150":"Field \'customfield_13150\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13142":"Field \'customfield_13142\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13144":"Field \'customfield_13144\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13143":"Field \'customfield_13143\' cannot be set. It is not on the appropriate screen, or unknown.","description":"Field \'description\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13146":"Field \'customfield_13146\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13145":"Field \'customfield_13145\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13148":"Field \'customfield_13148\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13147":"Field \'customfield_13147\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13169":"Field \'customfield_13169\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_13149":"Field \'customfield_13149\' cannot be set. It is not on the appropriate screen, or unknown."}}'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/cli.py", line 153, in cli
    ingest.ingest(int(observed_since), first_discovery)
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/transform.py", line 650, in ingest
    self.create_issues(vulns)
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/transform.py", line 498, in create_issues
    self._process_open_vuln(v, fid)
  File "/Users/<USER_REDACTED>/oss-projects/integration-jira-cloud/venv/lib/python3.8/site-packages/tenable_jira/transform.py", line 381, in _process_open_vuln
    sys.exit(2)
SystemExit: 2

Available IssueTypes

11: Sub-task
3: Task
11222: Task
11210: Subtask
11208: Task
11220: Subtask
11218: Task
11224: Subtask

/-------------------------------NOTICE-----------------------------------
| The output above is helpful for us to troubleshoot exactly what is |
| happening within the code and offer a diagnosis for how to correct. |
| Please note that while some basic redaction has already been performed |
| that we ask you to review the information you're about to send and |

ensure that nothing deemed sensitive is transmitted.
-- Copy of output saved to "issue_debug.md"
------------------------------------------------------------------------/

@SteveMcGrath
Copy link
Collaborator

Well there is the issue:

2021-03-30 13:17:13,068 tenable_jira.transform.Tio2Jira INFO Using JIRA Screens []

What you will likely need to do is get the screen IDs and hard-code them into your config. Follow the following instructions:

#23 (comment)

To get the screen ids, you'll need to look in the URL path. In Jira's most recent UI, its at the end of the URL and looks like id=XXXXX. You should have 3 screens listings that should total 2 screen IDs (typically the view and edit screen are the same).

I really wish they would relay to the user what the IDs were in a more transparent way, sadly they do not.

CleanShot 2021-03-31 at 09 35 52

@ghost
Copy link
Author

ghost commented Mar 31, 2021

🤔
Before creating this new issue I sifted through the older ones and one mentioned this ScreenID. I tried retrieving them using the given methodology but got no luck.
The URLs I get while navigating the project do not have any Id param.
Out of curiosity, what's the Project Type in your Jira instance ?
It seems my new project is created as "Next Gen Software Project" whereas some older existing ones in our Jira instance are either "Classic Software Project" or "Classic Business Project".

@SteveMcGrath
Copy link
Collaborator

Did you create the project, or did the integration?

@ghost
Copy link
Author

ghost commented Mar 31, 2021

I created it. That may be the issue.
Will delete it and restart from scratch letting the Integation create it for me.

@SteveMcGrath
Copy link
Collaborator

SteveMcGrath commented Mar 31, 2021

yeah, now Jira doesn't always play nice with re-used keys, you may need to add the key attribute to the jira stanza like so:

jira:
  key: VULNMNGT

@ghost
Copy link
Author

ghost commented Mar 31, 2021

Fiddled aorund with the projects, got the integration doing all the job (creating a new project and customizing it).
It works perfectly.
Thanks for your support, @SteveMcGrath . Much appreciated.

@ghost ghost closed this as completed Mar 31, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant