clonemeagain / osticket-slack

a Slack plugin for osTicket
MIT License
47 stars 34 forks source link

URL in Slack message is incorrect #40

Open mudslide567 opened 11 months ago

mudslide567 commented 11 months ago

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

Shadow00Caster commented 10 months ago

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)