-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RTIR - handle '409 Syntax Error' (#38777)
* handle '409 Syntax Error' * Update Packs/RTIR/ReleaseNotes/1_0_24.md Co-authored-by: israelpoli <[email protected]> --------- Co-authored-by: israelpoli <[email protected]>
- Loading branch information
1 parent
e8e2337
commit 37527ac
Showing
4 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -305,3 +305,28 @@ def test_edit_ticket(mocker): | |
edit_ticket() | ||
except Exception as ex: | ||
assert ex.message == 'No arguments were given to edit the ticket.' | ||
|
||
|
||
def test_create_ticket_409_failure(mocker): | ||
args = { | ||
'queue': 'test', | ||
'subject': 'Test Ticket', | ||
'requestor': '[email protected]', | ||
'priority': 'High', | ||
'text': 'This is a test ticket', | ||
} | ||
|
||
mock_response = DotDict({ | ||
'status_code': 200, | ||
'text': 'RT/5.0.3 409 Syntax Error\nTicket creation failed' | ||
}) | ||
|
||
mocker.patch.object(demisto, 'args', return_value=args) | ||
mocker.patch('RTIR.create_ticket_request', return_value=mock_response) | ||
|
||
from RTIR import create_ticket | ||
with pytest.raises(DemistoException) as e: | ||
create_ticket() | ||
|
||
assert "Ticket creation failed" in str(e.value) | ||
assert "RT/5.0.3 409 Syntax Error" in str(e.value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
#### Integrations | ||
|
||
##### RTIR | ||
|
||
- Fixed an issue where the `rtir-create-ticket` command did not raise an error when the ticket was not created due to a syntax error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters