Hi Bernhard,

Yes something like that is possible (see attached image). We needed to modify 
share/html/Elements/CollectionsAsTable/Row (By overwriting it via the 
local-Folder) to include the title or key of the shown value in the rendered 
html. (See attached)

With this modification, we can find the customfield-values in the 
search-results with a jQuery-Selector: var prio_tds = 
jQuery('td[data-fieldkey="__Priority__"]');

And then we can do many funny things to these html elements ;) like replacing 
it with a button and attaching an ajax-call to this button.

Cheers,
Vinzenz
Vinzenz Sinapius
Information Technology | Informationstechnik

tracetronic GmbH
Stuttgarter Str. 3
01189 DRESDEN
GERMANY

Phone: +49 351 205768-167
Fax: +49 351 205768-999
E-mail: vinzenz.sinap...@tracetronic.de<mailto:vinzenz.sinap...@tracetronic.de>

Head Office | Hauptsitz: Stuttgarter Str. 3, 01189 DRESDEN, GERMANY
Managing Directors | Geschäftsführer: Dr.-Ing. Rocco Deutschmann, Dr.-Ing. 
Peter Strähle
Registration Court | Registergericht: Amtsgericht Dresden, HRB 23 086


Von: Eierschmalz, Bernhard [mailto:bernhard.eierschm...@scheppach.com]
Gesendet: Mittwoch, 13. April 2016 11:54
An: Sinapius, Vinzenz <vinzenz.sinap...@tracetronic.de>
Cc: rt-users@lists.bestpractical.com
Betreff: AW: Change CF with HTTP

Hi Vinzenz,

thanks so far - I'm not sure if this will work for me.
So let me explain my whole problem, maybe you have a better solution to reach 
help me.

I have a fax-server wich sends faxes as mail into RT. So the mails are always 
with the same content and attached there is a PDF-file with the fax-document.
I have one custom field for my queue called "category"
Our staff need to sort the fax-tickets into different categories, using this 
custom field. (so this team only sorts the tickets - once the ticket is sorted 
into the category, it will appear in another team to work on the ticket)
In the moment, the "sorting staff" have to open one ticket after another, open 
the attached pdf-file, change the CF-value and go to the next ticket.
So the colleagues asked me for an easier way.


My idea was the following:
I create one search for all the unsorted faxes. As format I define like the 
following:
<ticket-ID>,<ticketSubject>,<requestor>,<categoryA>,<categoryB>,...
On the column "CategoryA" there should be a link to change custom field of this 
ticket to cagetory A, same for the other categories.
The "high-end-solution" would be also to have directly a link to the attached 
PDF-file from the search - but I don't belive this is possible.


do you think this way will be working? Or do you have another solution for my 
problem?


Best regards
Bernhard

Von: Sinapius, Vinzenz [mailto:vinzenz.sinap...@tracetronic.de]
Gesendet: Mittwoch, 13. April 2016 09:52
An: Eierschmalz, Bernhard
Betreff: AW: Change CF with HTTP

Hi Bernhard,

AFAIK you currently can't update tickets with 
querystrings<https://en.wikipedia.org/wiki/Query_string>. For the REST-API you 
need to put key-value-pairs in the body of a POST 
Request<https://en.wikipedia.org/wiki/POST_(HTTP)>.

You can do this with javascript, here is a function I use in our Instance to 
update the priority of a ticket. You can use this to build something similar 
and attach it to a button or something similar.

function set_ticket_prio(priority, ticket_id){
                url = 
"https://ticketserver/rt/REST/1.0/ticket/__id__/edit".replace('__id__', 
ticket_id);
                data = 'content=Priority: __prio__'.replace('__prio__', 
priority);
                jQuery.ajax({type:"POST", url:url, data:data, success: 
refresh_table});
}

Cheers,
Vinzenz
Vinzenz Sinapius
Information Technology | Informationstechnik

tracetronic GmbH
Stuttgarter Str. 3
01189 DRESDEN
GERMANY

Phone: +49 351 205768-167
Fax: +49 351 205768-999
E-mail: vinzenz.sinap...@tracetronic.de<mailto:vinzenz.sinap...@tracetronic.de>

Head Office | Hauptsitz: Stuttgarter Str. 3, 01189 DRESDEN, GERMANY
Managing Directors | Geschäftsführer: Dr.-Ing. Rocco Deutschmann, Dr.-Ing. 
Peter Strähle
Registration Court | Registergericht: Amtsgericht Dresden, HRB 23 086


Von: Eierschmalz, Bernhard [mailto:bernhard.eierschm...@scheppach.com]
Gesendet: Mittwoch, 13. April 2016 08:16
An: Sinapius, Vinzenz 
<vinzenz.sinap...@tracetronic.de<mailto:vinzenz.sinap...@tracetronic.de>>
Cc: rt-users@lists.bestpractical.com<mailto:rt-users@lists.bestpractical.com>
Betreff: AW: Change CF with HTTP

Hi Vinzenz,

Thanks, but I'm not sure how to do this.

I think I have a URL like this:
http://<ticketserver>/REST/1.0/ticket/<ticketno>/edit<http://%3cticketserver%3e/REST/1.0/ticket/%3cticketno%3e/edit>.....

but how do I change a CF?

I already tried
http://<ticketserver>/REST/1.0/ticket/<ticketno>/edit?CF.{<CFname>}:<CFvalue<http://%3cticketserver%3e/REST/1.0/ticket/%3cticketno%3e/edit?CF.%7b%3cCFname%3e%7d:%3cCFvalue>>

and
http://<ticketserver>/REST/1.0/ticket/<ticketno>/edit?CF.{<CFname>}=<CFvalue<http://%3cticketserver%3e/REST/1.0/ticket/%3cticketno%3e/edit?CF.%7b%3cCFname%3e%7d=%3cCFvalue>>

both didn't work.

Just to make sure what I want:
I need one URL where a user can click and with opening this URL a CF value is 
changed.
Will this work with REST?


Best regards
Bernhard


Von: Sinapius, Vinzenz [mailto:vinzenz.sinap...@tracetronic.de]
Gesendet: Dienstag, 12. April 2016 16:59
An: Eierschmalz, Bernhard
Betreff: AW: Change CF with HTTP

Hi Bernhard,

You can use wget/curl and the REST-API: 
http://requesttracker.wikia.com/wiki/REST

Cheers,
Vinzenz
Vinzenz Sinapius
Information Technology | Informationstechnik

tracetronic GmbH
Stuttgarter Str. 3
01189 DRESDEN
GERMANY

Phone: +49 351 205768-167
Fax: +49 351 205768-999
E-mail: vinzenz.sinap...@tracetronic.de<mailto:vinzenz.sinap...@tracetronic.de>

Head Office | Hauptsitz: Stuttgarter Str. 3, 01189 DRESDEN, GERMANY
Managing Directors | Geschäftsführer: Dr.-Ing. Rocco Deutschmann, Dr.-Ing. 
Peter Strähle
Registration Court | Registergericht: Amtsgericht Dresden, HRB 23 086


Von: rt-users [mailto:rt-users-boun...@lists.bestpractical.com] Im Auftrag von 
Eierschmalz, Bernhard
Gesendet: Dienstag, 12. April 2016 14:58
An: rt-users@lists.bestpractical.com<mailto:rt-users@lists.bestpractical.com>
Betreff: [rt-users] Change CF with HTTP

Hello,

is it possible to change a CF with a http command like
http://$ipaddress/rt/Modify.html?id=<ticketno>;CF=<customfield-ID>;CFval=<customfield-value<http://$ipaddress/rt/Modify.html?id=%3cticketno%3e;CF=%3ccustomfield-ID%3e;CFval=%3ccustomfield-value>>
?

Thank you in advice

Best regards
Bernhard

Attachment: Row
Description: Row

---------
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Washington DC - May 23 & 24, 2016

Reply via email to