Category Archives: JIRA

Introduction to Single Sign On (SSO) and SAML

Single Sign On (SSO) is a facility for all users by which they can manage their all accounts using one login they no need to do manage more accounts (User Id and Passwords). In SSO user gain access in multiple sites using just single log in. Single Sign On (SSO) is independent software system.

Mirketa-Single-Sign-On

Continue reading

Posted in Agile, AGILE Tools, apex develeopment, force.com app development, HTML/CSS, JIRA, Salesforce, Salesforce Challenges, Salesforce cloud Implementation, salesforce community implementation, salesforce connectors, salesforce consultant, salesforce Tips & Tricks, Salesforce.com, sfdc, Team Collaboration, think build transform.

Add Atlassian to your Process – Startup Guide

As a newbie in plugin development for atlassian products suite, I faced many obstacles and challenges while developing a simple plugin, from setting up the development environment, reading APIs to setting up the fast development process. So, I decided to write this simple, step-by-step and descriptive blog for future plugin developers to take advantage of my endeavor and experience with atlassian plugin development. In this blog I will cover- Setting up the development environment out of:

 

blog

Continue reading

Posted in Agile, AGILE Tools, JIRA, process engineering.

Atlassian Development: Create an issue in Jira from your plugin

To create an issue in Jira, first you need to import the following classes in your java file

import com.atlassian.crowd.embedded.api.User;
import com.atlassian.jira.bc.issue.IssueService;
import com.atlassian.jira.bc.issue.IssueService.CreateValidationResult;
import com.atlassian.jira.bc.issue.IssueService.IssueResult;
import com.atlassian.jira.issue.IssueInputParameters;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.security.JiraAuthenticationContext;
import com.atlassian.jira.util.ErrorCollection;
import com.atlassian.jira.component.ComponentAccessor;

After importing these file in your java files, write the below code in the function where you want to create an issue

First create an object of IssueService class from the class ComponentAccessor

IssueService issueService = ComponentAccessor.getIssueService();

Create an object of IssueInputParameters, later these parameter will be validated

IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();

Set the parameters to the issueInputParameters object, most important parameters are:

projectId-> Id of the project to which you want the issue to add

reporterId->Reporter of the issue like admin etc.

assigneeId->User to whom the issue is assigned

issueInputParameters.setProjectId(projectId).setIssueTypeId(“1”).setSummary(“issue summary”)
.setReporterId(reporterId).setAssigneeId(assigneeId).setDescription(“issue description”)
.setStatusId(“1”).setPriorityId(“2”);

Now we need to fetch the current user, by the following lines, we are fetching the logged in user

JiraAuthenticationContext authenticationContext = ComponentAccessor.getJiraAuthenticationContext();
User user = authenticationContext.getLoggedInUser();

Validate the issueInputParameters and user

CreateValidationResult createValidationResult = issueService.validateCreate(user, issueInputParameters);

if createValidationResult return true, it means all is well so far then

MutableIssue issue=null;

IssueResult createResult = issueService.create(user, createValidationResult);

if (createResult.isValid()) {
issue = createResult.getIssue();
} else {
Collection<String> errorMessages = createResult.getErrorCollection().getErrorMessages();
for (String errorMessage : errorMessages) {
//wite the exception in logs
}
}

if createValidationResult return false, then fetch the exceptions and errors and write these to the logs

Collection<String> errorMessages = createValidationResult.getErrorCollection().getErrorMessages();
for (String errorMessage : errorMessages) {
//wite the exception in logs
}
Map<String, String> errors = createValidationResult.getErrorCollection().getErrors();
Set<String> errorKeys = errors.keySet();
for (String errorKey : errorKeys) {
//wite the error in logs
}

Cheers

 

Posted in AGILE Tools, JIRA.

Atlassian Development : Sample code to get the list of projects from your JIRA instance..

In this blog post I will be sharing tips on how to populate a list of projects from your JIRA instance. The project list can be useful for features where you need to relate a particular issue to multiple projects or clone an issue under multiple projects.

select_projects

Getting the list of projects from JIRA database is a fairly straight forward task. Follow these steps to get the list:

 

  1. First import the required classes in your java file where you want to fetch all the current JIRA projects. Here are the commands for the importing files
  • import com.atlassian.jira.project.Project;
  • import com.atlassian.jira.component.ComponentAccessor;

 

  1. Now in the file, where you need to get the list of all current projects, write the following code
    • List projects=ComponentAccessor.getProjectManager().getProjectObjects();

Here the object projects is an Array List of type com.atlassian.jira.project.Project. You can get all the information of the projects from this ArrayList. Simple enough ?

 

 

Cheers

 

Posted in Agile, AGILE Tools, JIRA. Tagged with , .