Configure custom URL for the Jira Service Management customer portal

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Purpose

This article discusses one option for configuring custom URLs for the Jira Service Management customer portal. This will allow you to provide a simple URL that customers can use to access the portal.

  • This solution applies to the Server version of Jira Service Management 3.0+
    • This solution will not work in older versions and is not available in Jira Cloud.
  • This is a workaround for JSD-513 - Getting issue details... STATUS
  • This may also help you to workaround JSD-1627 - Getting issue details... STATUS
tip/resting Created with Sketch.

This article is only for accessing the portal using an alternate URL that is simpler than the default portal URL. This article does not seek to change the URLs that appear in the Jira UI or in notifications. In those cases the Base URL and default Service Management URLs will be used.

Be aware that these changes are customizations and are not supported by Atlassian.  Support is not able to assist with this making this modification or troubleshooting issues that may arise. For assistance please post to Atlassian Answers.

Solution

Steps for Configuring Alternate URLs

This method uses the Rewrite Valve that was introduced in Tomcat 8.

  • Tomcat 8 is the application server included in Jira 7.0+ and Jira Service Management 3.0+. Older versions used Tomcat 7 so this solution will not work prior to Jira 7.0 and Service Management 3.0.

Step 1: Configure Rewrite Valve

First you will need to tell Tomcat that it should use the Rewrite Valve. The simplest way is to do the following:

  1. Edit  Jira_INSTALL/conf/context.xml
  2. Add the <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" /> line to this file. Place this above the line containing </Context>:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

    <!-- Default set of monitored resources. If one of these changes, the    -->
    <!-- web application will be reloaded.                                   -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->
    <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
</Context>

Be sure to save the file after making the change. This change will take effect after Jira is restarted.

  • Before restarting Jira, proceed to step 2 and configure your rewrite rules

Step 2: Create Rewrite Configuration File

Rewrite rules are configured in a rewrite.config file that you will need to create. This file is placed in the Jira_INSTALL/atlassian-jira/WEB-INF directory.

  1. Create a file named rewrite.config and place it in the Jira_INSTALL/atlassian-jira/WEB-INF directory.
    1. The final path should be Jira_INSTALL/atlassian-jira/WEB-INF/rewrite.config
    2. The user that Jira runs as must be able to read this file. This file should have the same permissions as the other files in WEB-INF directory.

Step 3: Add Rewrite Rules

The rewrite.config file is where you define the rewrite conditions and rules. RewriteCond and RewriteRule are discussed in the Tomcat Rewrite Valve Documentation.

Atlassian Support is not able to assist with configuring or troubleshooting rewrite rules. For assistance please post to Atlassian Answers.

Redirecting Subdomain to Customer Portal

The following example will redirect requests sent to "support.domain.com" to the customer portal located at "jira.domain.com"

RewriteCond %{HTTP_HOST} ^support\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://jira.domain.com/servicedesk/customer/portals [R=301,L]
Redirecting Multiple Subdomains to Customer Portal

The following example will redirect requests sent to "subdomain1.domain.com" and "subdomain2.domain.com" to the customer portal located at "jira.domain.com"

RewriteCond %{HTTP_HOST} ^(subdomain1|subdomain2)\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://jira.domain.com/servicedesk/customer/portals [R=301,L]
Redirecting Subdomain to Specific Service Management Portal

The following example will redirect requests sent to "desktopsupport.domain.com" to the desktop support customer portal which is located on "jira.domain.com" and has ID "2"

RewriteCond %{HTTP_HOST} ^desktopsupport\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://jira.domain.com/servicedesk/customer/portal/2 [R=301,L]
Redirecting Subdomain to Specific Request Type Form

The following example will redirect requests sent to "helprequest.domain.com" to the request type form with ID "4" which is located in the service project portal with ID "2"

RewriteCond %{HTTP_HOST} ^helprequest\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://jira.domain.com/servicedesk/customer/portal/2/create/4 [R=301,L]

Step 4: Test the new configuration

If testing different configurations in the rewrite.config file, the browser may cache the URL redirection so you may need to clear the browsing history between tests to property test any changes you made.

Alternate Methods

This is only one method of configuring an alternate URL.

You may also consider using the tuckey URL Rewrite library (http://tuckey.org/urlrewrite/) which comes bundled in Jira's tomcat

Other methods include the use of a proxy server, such as Apache or Nginx, to rewrite the URLs. Other methods are discussed in the comments on JSD-513 - Getting issue details... STATUS

DescriptionThis article discusses one option for configuring custom URLs for the Jira Service Management customer portal. This will allow you to provide a simple URL that customers can use to access the portal.
ProductJira
PlatformServer
Last modified on Feb 7, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.