Letting customers only create issues

Usage FAQ

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

This page describes a minor JIRA modification which redirects users to an arbitrary page after creating issues (and potentially other operations). It is mainly of interest to JIRA Professional and Standard users.

シナリオ

When JIRA is used in a public environment, it is often useful for customers to be able to raise issues directly, but not see other customers' issues.

You can also grant the Reporter (and your company groups) the Browse Issue permission. Customers can then view issues they have raised.

In JIRA Professional and Standard, Reporter isn't available, and permissions can only be granted/denied per group. We want the Create Issue permission granted to everyone, but Browse Projects denied:

Users will see a permission error after creating an issue - not very customer-friendly!

Redirecting to a custom page

What we want is the ability to redirect the user to a nice "Thanks for raising an issue" page. We might want to direct to a different page depending on which groups the user is in. This can be done as follows:

Modify actions.xml

Open atlassian-jira/WEB-INF/classes/actions.xml in your JIRA Installation Directory. If you are using the JIRA WAR distribution, first copy webapp/WEB-INF/classes/actions.xml to edit-webapp/WEB-INF/classes in your JIRA Installation Directory and edit actions.xml there.

以下の部分に移動します。

<action name="issue.ViewIssue" alias="ViewIssue">
<view name="success">/secure/views/issue/viewissue.jsp</view>
<view name="rss">/secure/views/issue/viewissue-rss.jsp</view>
<view name="issuenotfound">/secure/views/issuenotfound.jsp</view>
<view name="permissionviolation">/secure/views/permissionviolation.jsp</view>

<command name="moveIssueLink" alias="MoveIssueLink">
<view name="error">/secure/views/issue/viewissue.jsp</view>
</command>
</action>

Modify the permissionviolation page to /redirectusers.jsp:

<view name="permissionviolation">/redirectusers.jsp</view>

Create a redirect JSP

Now create atlassian-jira/redirectusers.jsp (in your JIRA Installation Directory (or for JIRA WAR distributions, the edit-webapp/redirectusers.jsp of the JIRA Installation Directory), containing something like this:

<%@ page import="com.opensymphony.user.User"%>
<%
User user = com.opensymphony.user.UserManager.getInstance().getUser(request.getRemoteUser());
if (user.inGroup("customerA-users")) {
response.sendRedirect("http://localhost/thankyou.jsp?user="+user);
} else {
response.sendReirect("http://localhost/thankyou.jsp");
}
%>

Your logic group(s) to check for and redirect URLs will be different. If you don't want to create a custom page, you can redirect to request.getContextPath()+"/secure/Dashboard.jspa"

デプロイ

Simply restart JIRA (or if you are using the WAR distribution, run build.bat or build.sh to regenerate the .war file and redeploy this in your application server).

最終更新日 2011 年 11 月 9 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.