Issue Summary
When using AMPS to run jira-software and jira-servicedesk, the Service desk images and links do not work.
Steps to Reproduce
- atlas-create-jira-plugin
- Add to pom.xml in <dependencies/>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.servicedesk</groupId>
<artifactId>jira-servicedesk-api</artifactId>
<version>${jira.servicedesk.application.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
- Add to pom.xml in <application/>
<applications>
<application>
<applicationKey>jira-servicedesk</applicationKey>
<version>${jira.servicedesk.application.version}</version>
</application>
</applications>
- Add to pom.xml in <properties/>
<jira.version>9.1.0</jira.version>
<jira-servicedesk.version>5.1.0</jira-servicedesk.version>
- Start Jira with atlas-run or atlas-debug
- Go to http://localhost:2990/jira
- Log in with admin/admin and create an IT Service Management project
- Click on Customer channels and then visit the portal
Results
Actual Results
The portal looks like

HTML image tags have undefined
<img alt="Get IT help" class="vp-rq-icon" src="undefined/servicedesk/customershim/secure/viewavatar?avatarType=SD_REQTYPE&avatarId=10627">
Going to the portal with http://localhost:2990/jira/servicedesk/customer/portal/1/create/1 shows

As per the source graph and the soy template used, the code is been generated from the Jira service desk front end.
{template .icon}
<img {if $alt}alt="{$alt}"{else}aria-hidden="true"{/if} {if $style}style="{$style}" {/if}class="{if $class}{$class} {/if}vp-rq-icon" src="{contextPath()}
{if $useCustomerShim}
/servicedesk/customershim{/if}/secure/viewavatar?avatarType=SD_REQTYPE&avatarId={$iconId}" {if $title}title="{$title}"{/if} {if $dataKey}data-{$dataKey}="{$dataValue}"{/if}>
{/template}
The contextPath() is coming as undefined, which is the why the img url is coming as undefined.
Expected Results
Service Desk works as expected.
Workaround
Instead of using jira-maven-plugin with a Jira version, it may work with using a specific product instead
<configuration>
<products>
<product>
<id>jira</id>
<instanceId>jira</instanceId>
<version>${jira.version}</version>
</product>
</products>
<applications>
<application>
<applicationKey>jira-servicedesk</applicationKey>
<version>${jira-servicedesk.version}</version>
</application>
</applications>
...
</configuration>