Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ebiwd
rthelper
Commits
a4add18b
Commit
a4add18b
authored
Mar 10, 2022
by
Sandeep Kadam
Browse files
Added more fixes to show selected custom field & queues
parent
d17219cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
rthelper.user.js
rthelper.user.js
+5
-5
No files found.
rthelper.user.js
View file @
a4add18b
...
...
@@ -141,7 +141,7 @@ function getName(full) {
* @return String, eg "Web Development"
*/
function
getQueue
()
{
return
getElementText
(
'
div.ticket-info-basics div.queue
div.value
'
).
split
(
'
\n
'
)[
0
];
return
getElementText
(
'
div.ticket-info-basics div.queue
span.current-value
'
,
'
text
'
).
split
(
'
\n
'
)[
0
];
}
/**
...
...
@@ -149,7 +149,7 @@ function getQueue() {
* @return String, eg
*/
function
getOwner
()
{
var
owner
=
getElementText
(
'
div.ticket-info-people
div.
value
'
,
'
text
'
).
split
(
'
\n
'
)[
0
];
var
owner
=
getElementText
(
'
div.ticket-info-people
span.current-
value
'
,
'
text
'
).
split
(
'
\n
'
)[
0
];
if
(
owner
.
indexOf
(
'
(
'
)
!==
-
1
)
{
owner
=
/
\((
.*
)\)
/gi
.
exec
(
owner
)[
1
];
}
...
...
@@ -161,7 +161,8 @@ function getOwner() {
* @return String
*/
function
getCustomField
(
id
)
{
return
getElementText
(
'
div.ticket-info-cfs div.custom-field div#CF-
'
+
id
+
'
-ShowRow div.value
'
,
'
text
'
).
split
(
'
\n
'
,
1
)[
0
];
var
field_val
=
getElementText
(
'
div#CF-
'
+
id
+
'
-ShowRow span.current-value
'
,
'
text
'
).
split
(
'
\n
'
,
1
)[
0
];
return
field_val
;
}
/**
...
...
@@ -488,6 +489,7 @@ function init() {
var
queues
=
getQueues
();
var
queue
;
container
=
document
.
querySelector
(
'
div.ticket-info-basics div.queue div.value
'
);
if
(
!
container
)
{
return
;
}
...
...
@@ -893,8 +895,6 @@ function init() {
var
temp
=
document
.
createElement
(
'
div
'
);
temp
.
innerHTML
=
response
.
responseText
;
setValue
(
'
name
'
,
temp
.
querySelector
(
'
div.RealName span.value
'
).
innerHTML
);
var
queueOptions
=
temp
.
querySelectorAll
(
'
select[name="Queue"] option
'
);
for
(
var
queueOption
in
queueOptions
)
{
if
(
queueOptions
[
queueOption
].
value
&&
queueOptions
[
queueOption
].
text
)
{
...
...
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