Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
Adds Epic Id and Story Id to properties file (#2770)
Browse files Browse the repository at this point in the history
* Adds Epic Id and Story Id to properties file

* Fix for Test cases
  • Loading branch information
Sbrenthughes committed Mar 7, 2019
1 parent 22502c2 commit 278e1bd
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
Expand Up @@ -73,8 +73,6 @@ public class DefaultJiraClient implements JiraClient {
private static final String STATIC_ISSUE_FIELDS = "id,key,issuetype,status,summary,created,updated,project,issuelinks,assignee,sprint,epic,aggregatetimeoriginalestimate,timeoriginalestimate";

private static final String DEFAULT_ISSUE_TYPES = "Story,Epic";
private static final String JIRA_STORY = "7";
private static final String JIRA_EPIC = "6";
private static final int JIRA_BOARDS_PAGING = 50;
private final FeatureSettings featureSettings;
private final RestOperations restOperations;
Expand Down Expand Up @@ -358,12 +356,12 @@ private IssueResult getFeaturesFromQueryURL(String url, Map<String, Epic> epicMa
JSONObject issueJson = (JSONObject) issue;
String type = getIssueType(issueJson);

if (JIRA_EPIC.equals(type)) {
if (!StringUtils.isEmpty(featureSettings.getJiraEpicId()) && featureSettings.getJiraEpicId().equals(type)) {
saveEpic(issueJson, epicMap, true);
return;
}

if (JIRA_STORY.equalsIgnoreCase(type)) {
if (!StringUtils.isEmpty(featureSettings.getJiraStoryId()) && featureSettings.getJiraStoryId().equals(type)) {
Feature feature = getFeature((JSONObject) issue, board);
String epicId = feature.getsEpicID();
if (!StringUtils.isEmpty(epicId)) {
Expand Down
Expand Up @@ -86,6 +86,24 @@ public class FeatureSettings {
*/
@Value("${feature.collectorItemOnlyUpdate:true}")
private boolean collectorItemOnlyUpdate;
/**
* In Jira, your instance will have its own Id for the Story
* <p>
* </p>
* <strong>Note:</strong> You can retrieve your instance's Story ID
* via the following URI
* https://[your-jira-domain-name]/rest/api/2/issuetype
*/
private String jiraStoryId;
/**
* In Jira, your instance will have its own Id for the Epic
* <p>
* </p>
* <strong>Note:</strong> You can retrieve your instance's Epic ID
* via the following URI
* https://[your-jira-domain-name]/rest/api/2/issuetype
*/
private String jiraEpicId;

public boolean isCollectorItemOnlyUpdate() {
return collectorItemOnlyUpdate;
Expand Down Expand Up @@ -254,4 +272,20 @@ public boolean isJiraBoardAsTeam() {
public void setJiraBoardAsTeam(boolean jiraBoardAsTeam) {
this.jiraBoardAsTeam = jiraBoardAsTeam;
}

public String getJiraStoryId() {
return jiraStoryId;
}

public void setJiraStoryId(String jiraStoryId) {
this.jiraStoryId = jiraStoryId;
}

public String getJiraEpicId() {
return jiraEpicId;
}

public void setJiraEpicId(String jiraEpicId) {
this.jiraEpicId = jiraEpicId;
}
}
Expand Up @@ -27,6 +27,8 @@ public FeatureSettings featureSettings() {
settings.setJiraEpicIdFieldName("customfield_10003");
settings.setJiraStoryPointsFieldName("customfield_10004");
settings.setMaxNumberOfFeaturesPerBoard(10000);
settings.setJiraEpicId("6");
settings.setJiraStoryId("7");


return settings;
Expand Down

0 comments on commit 278e1bd

Please sign in to comment.