Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyOTRS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Som Connexió
OTRS
PyOTRS
Commits
070f222a
Commit
070f222a
authored
7 years ago
by
Robert Habermann
Browse files
Options
Downloads
Patches
Plain Diff
add option to get for html body as attachment
parent
3405aef3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyotrs/lib.py
+18
-6
18 additions, 6 deletions
pyotrs/lib.py
with
18 additions
and
6 deletions
pyotrs/lib.py
+
18
−
6
View file @
070f222a
...
@@ -1128,7 +1128,8 @@ class Client(object):
...
@@ -1128,7 +1128,8 @@ class Client(object):
ticket_id
,
ticket_id
,
articles
=
False
,
articles
=
False
,
attachments
=
False
,
attachments
=
False
,
dynamic_fields
=
True
):
dynamic_fields
=
True
,
html_body_as_attachment
=
False
):
"""
ticket_get_by_id
"""
ticket_get_by_id
Args:
Args:
...
@@ -1138,6 +1139,8 @@ class Client(object):
...
@@ -1138,6 +1139,8 @@ class Client(object):
Articles (*default: False*)
Articles (*default: False*)
dynamic_fields (bool): will request OTRS to include all
dynamic_fields (bool): will request OTRS to include all
Dynamic Fields (*default: True*)
Dynamic Fields (*default: True*)
html_body_as_attachment (bool): Optional, If enabled the HTML body version of
each article is added to the attachments list
Returns:
Returns:
**Ticket** or **False**: Ticket object if successful, otherwise **False**.
**Ticket** or **False**: Ticket object if successful, otherwise **False**.
...
@@ -1153,7 +1156,8 @@ class Client(object):
...
@@ -1153,7 +1156,8 @@ class Client(object):
"
TicketID
"
:
"
{0}
"
.
format
(
ticket_id
),
"
TicketID
"
:
"
{0}
"
.
format
(
ticket_id
),
"
AllArticles
"
:
int
(
articles
),
"
AllArticles
"
:
int
(
articles
),
"
Attachments
"
:
int
(
attachments
),
"
Attachments
"
:
int
(
attachments
),
"
DynamicFields
"
:
int
(
dynamic_fields
)
"
DynamicFields
"
:
int
(
dynamic_fields
),
"
HTMLBodyAsAttachment
"
:
int
(
html_body_as_attachment
),
}
}
if
not
self
.
_parse_and_validate_response
(
self
.
_send_request
(
payload
)):
if
not
self
.
_parse_and_validate_response
(
self
.
_send_request
(
payload
)):
...
@@ -1165,7 +1169,8 @@ class Client(object):
...
@@ -1165,7 +1169,8 @@ class Client(object):
ticket_id_list
,
ticket_id_list
,
articles
=
False
,
articles
=
False
,
attachments
=
False
,
attachments
=
False
,
dynamic_fields
=
True
):
dynamic_fields
=
True
,
html_body_as_attachment
=
False
):
"""
ticket_get_by_list
"""
ticket_get_by_list
Args:
Args:
...
@@ -1175,6 +1180,8 @@ class Client(object):
...
@@ -1175,6 +1180,8 @@ class Client(object):
Articles (*default: False*)
Articles (*default: False*)
dynamic_fields (bool): will request OTRS to include all
dynamic_fields (bool): will request OTRS to include all
Dynamic Fields (*default: True*)
Dynamic Fields (*default: True*)
html_body_as_attachment (bool): Optional, If enabled the HTML body version of
each article is added to the attachments list
Returns:
Returns:
**list**: Ticket objects (as list) if successful, otherwise **False**.
**list**: Ticket objects (as list) if successful, otherwise **False**.
...
@@ -1193,7 +1200,8 @@ class Client(object):
...
@@ -1193,7 +1200,8 @@ class Client(object):
"
TicketID
"
:
'
,
'
.
join
([
str
(
item
)
for
item
in
ticket_id_list
]),
"
TicketID
"
:
'
,
'
.
join
([
str
(
item
)
for
item
in
ticket_id_list
]),
"
AllArticles
"
:
int
(
articles
),
"
AllArticles
"
:
int
(
articles
),
"
Attachments
"
:
int
(
attachments
),
"
Attachments
"
:
int
(
attachments
),
"
DynamicFields
"
:
int
(
dynamic_fields
)
"
DynamicFields
"
:
int
(
dynamic_fields
),
"
HTMLBodyAsAttachment
"
:
int
(
html_body_as_attachment
),
}
}
if
not
self
.
_parse_and_validate_response
(
self
.
_send_request
(
payload
)):
if
not
self
.
_parse_and_validate_response
(
self
.
_send_request
(
payload
)):
...
@@ -1205,7 +1213,8 @@ class Client(object):
...
@@ -1205,7 +1213,8 @@ class Client(object):
ticket_number
,
ticket_number
,
articles
=
False
,
articles
=
False
,
attachments
=
False
,
attachments
=
False
,
dynamic_fields
=
True
):
dynamic_fields
=
True
,
html_body_as_attachment
=
False
):
"""
ticket_get_by_number
"""
ticket_get_by_number
Args:
Args:
...
@@ -1215,6 +1224,8 @@ class Client(object):
...
@@ -1215,6 +1224,8 @@ class Client(object):
Articles (*default: False*)
Articles (*default: False*)
dynamic_fields (bool): will request OTRS to include all
dynamic_fields (bool): will request OTRS to include all
Dynamic Fields (*default: True*)
Dynamic Fields (*default: True*)
html_body_as_attachment (bool): Optional, If enabled the HTML body version of
each article is added to the attachments list
Raises:
Raises:
ValueError
ValueError
...
@@ -1235,7 +1246,8 @@ class Client(object):
...
@@ -1235,7 +1246,8 @@ class Client(object):
result
=
self
.
ticket_get_by_id
(
result_list
[
0
],
result
=
self
.
ticket_get_by_id
(
result_list
[
0
],
articles
=
articles
,
articles
=
articles
,
attachments
=
attachments
,
attachments
=
attachments
,
dynamic_fields
=
dynamic_fields
)
dynamic_fields
=
dynamic_fields
,
html_body_as_attachment
=
html_body_as_attachment
)
if
not
result
:
if
not
result
:
return
False
return
False
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment