Commits

Don Brown committed 6b7217e

ARA-66 Add issue_id and project_id to iframe url

Change-Id: If31489577e4bcb5005b91e01ca7bd2c0f689844d

Comments (0)

Files changed (1)

plugin/src/main/java/com/atlassian/labs/remoteapps/modules/jira/issuepanel/IFrameViewIssuePanel.java

 import java.util.Map;
 
 import com.atlassian.crowd.embedded.api.User;
+import com.atlassian.jira.issue.Issue;
+import com.atlassian.jira.project.Project;
 import com.atlassian.labs.remoteapps.api.PermissionDeniedException;
 import com.atlassian.labs.remoteapps.modules.IFrameRenderer;
 import com.atlassian.labs.remoteapps.modules.page.IFrameContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static com.google.common.collect.Maps.newHashMap;
+
 /**
  *
  */
         {
             User user = (User) context.get("user");
             String remoteUser = user != null ? user.getName() : null;
-            writer.write(iFrameRenderer.render(iFrameContext, remoteUser) );
+            Map<String,String[]> params = newHashMap();
+            params.put("issue_id", new String[]{context.containsKey("issue") ? ((Issue)context.get("issue")).getKey() : ""});
+            params.put("project_id", new String[]{context.containsKey("project") ? ((Project)context.get("project")).getKey() : ""});
+
+            writer.write(iFrameRenderer.render(iFrameContext, "", params, remoteUser));
         }
         catch (PermissionDeniedException ex)
         {