osticket-slack icon indicating copy to clipboard operation
osticket-slack copied to clipboard

URL in Slack message is incorrect

Open mudslide567 opened this issue 1 year ago • 1 comments

Showing as https://scp/tickets.php?id=10710

Should be https:///cp/tickets.php?id=10710 [note insertion of the /]

I corrected manually by editing slack.php and inserting the '/' [line 66] from:

$heading = sprintf('%s CONTROLSTART%sscp/tickets.php?id=%d|#%sCONTROLEND %s'

to:

$heading = sprintf('%s CONTROLSTART%s/scp/tickets.php?id=%d|#%sCONTROLEND %s'

This solves my problem

mudslide567 avatar Oct 26 '23 21:10 mudslide567

There are 3 places that need to be modified to resolve the links in the Slack messages inclusive of line 66 as @mudslide567 commented originally. This is because osTicket itself expects no trailing / on the Helpdesk URL.

in slack.php

line 66 and line 113 should reflect the below $heading = sprintf('%s CONTROLSTART%s/scp/tickets.php?id=%d|#%sCONTROLEND %s' (this add a / between %s and scp

line 171 should reflect the below 'title_link' => $cfg->getUrl() . '/scp/tickets.php?id=' . $ticket->getId(), (this adds a / in front of scp)

Shadow00Caster avatar Oct 31 '23 18:10 Shadow00Caster