Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
support_lens
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
harshavardhan.c
support_lens
Commits
3d775672
Commit
3d775672
authored
Jan 05, 2021
by
harshavardhan.c
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed a small bug while fetching the details for the case_details
parent
9a208466
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
scripts/core/handler/supportcase_setup_handler.py
scripts/core/handler/supportcase_setup_handler.py
+14
-4
No files found.
scripts/core/handler/supportcase_setup_handler.py
View file @
3d775672
...
@@ -145,6 +145,13 @@ class TicketSetupHandler:
...
@@ -145,6 +145,13 @@ class TicketSetupHandler:
self
.
mongo_obj
.
insert_one
(
database_name
=
DBMapping
.
support_lens_configuration
,
self
.
mongo_obj
.
insert_one
(
database_name
=
DBMapping
.
support_lens_configuration
,
collection_name
=
DBMapping
.
ticket_configuration
,
collection_name
=
DBMapping
.
ticket_configuration
,
json_data
=
insert_json
)
json_data
=
insert_json
)
count
=
2000
insert_list
=
list
()
for
i
in
range
(
0
,
100
):
insert_json
.
update
(
case_id
=
f
"case_{count}"
)
count
+=
1
insert_list
.
append
(
input_json
)
mongo_object
=
MongoConnect
()
if
input_json
[
"type"
]
.
lower
()
==
"edit"
:
if
input_json
[
"type"
]
.
lower
()
==
"edit"
:
query_json
=
{
"case_id"
:
input_json
[
"case_id"
]}
query_json
=
{
"case_id"
:
input_json
[
"case_id"
]}
case_data
=
self
.
mongo_obj
.
find_one
(
db_name
=
DBMapping
.
support_lens_configuration
,
case_data
=
self
.
mongo_obj
.
find_one
(
db_name
=
DBMapping
.
support_lens_configuration
,
...
@@ -339,10 +346,10 @@ class TicketSetupHandler:
...
@@ -339,10 +346,10 @@ class TicketSetupHandler:
}
}
},
},
{
{
'$
limit'
:
input_json
[
"records"
]
'$
skip'
:
int
(
input_json
[
"records"
])
*
(
int
(
input_json
[
"page"
])
-
1
)
},
},
{
{
'$
skip'
:
int
(
input_json
[
"records"
])
*
(
int
(
input_json
[
"page"
])
-
1
)
'$
limit'
:
input_json
[
"records"
]
}
}
]
]
if
input_json
[
"filters"
]:
if
input_json
[
"filters"
]:
...
@@ -361,15 +368,14 @@ class TicketSetupHandler:
...
@@ -361,15 +368,14 @@ class TicketSetupHandler:
db_name
=
DBMapping
.
support_lens_configuration
,
db_name
=
DBMapping
.
support_lens_configuration
,
collection_name
=
DBMapping
.
ticket_configuration
,
collection_name
=
DBMapping
.
ticket_configuration
,
list_for_aggregation
=
json_data
))
list_for_aggregation
=
json_data
))
json_data
.
pop
(
4
)
json_data
.
pop
(
3
)
json_data
.
pop
(
3
)
json_data
.
pop
(
2
)
total_records
=
list
(
self
.
mongo_obj
.
aggregate
(
total_records
=
list
(
self
.
mongo_obj
.
aggregate
(
db_name
=
DBMapping
.
support_lens_configuration
,
db_name
=
DBMapping
.
support_lens_configuration
,
collection_name
=
DBMapping
.
ticket_configuration
,
collection_name
=
DBMapping
.
ticket_configuration
,
list_for_aggregation
=
json_data
))
list_for_aggregation
=
json_data
))
users_list
=
list
()
users_list
=
list
()
for
record
in
records
:
for
record
in
records
:
print
()
time_diff
=
datetime
.
fromtimestamp
(
time
.
time
())
-
datetime
.
fromtimestamp
(
record
[
"last_updated_on"
])
time_diff
=
datetime
.
fromtimestamp
(
time
.
time
())
-
datetime
.
fromtimestamp
(
record
[
"last_updated_on"
])
days_obj
=
time_diff
.
days
days_obj
=
time_diff
.
days
hour_obj
=
time_diff
.
seconds
//
3600
hour_obj
=
time_diff
.
seconds
//
3600
...
@@ -524,9 +530,13 @@ class TicketSetupHandler:
...
@@ -524,9 +530,13 @@ class TicketSetupHandler:
]))
]))
users_list
=
dict
()
users_list
=
dict
()
for
user
in
users_data
:
for
user
in
users_data
:
if
"user_id"
not
in
user
:
continue
users_list
.
update
({
user
[
"user_id"
]:
user
[
"username"
]})
users_list
.
update
({
user
[
"user_id"
]:
user
[
"username"
]})
for
key
,
value
in
users_json
.
items
():
for
key
,
value
in
users_json
.
items
():
if
key
in
[
None
,
""
]:
continue
return_json
.
append
({
return_json
.
append
({
"name"
:
users_list
[
key
],
"name"
:
users_list
[
key
],
"subTitle"
:
f
"{value} Cases"
,
"subTitle"
:
f
"{value} Cases"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment