Skip to content

Commit

Permalink
Merge pull request #1823 from akto-api-security/hotfix/fixing_jira_du…
Browse files Browse the repository at this point in the history
…p_issue

fix: creating jira ticket with a unique title
  • Loading branch information
Ark2307 authored Dec 18, 2024
2 parents e37db62 + 81c5d1e commit c5d3957
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
package com.akto.action;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.concurrent.TimeUnit;

import org.apache.commons.io.FileUtils;
Expand Down Expand Up @@ -199,8 +191,16 @@ public String createIssue() {
BasicDBObject reqPayload = new BasicDBObject();
BasicDBObject fields = new BasicDBObject();

String endpoint = jiraMetaData.getEndPointStr().replace("Endpoint - ", "");
String truncatedEndpoint = endpoint;
if(endpoint.length() > 30) {
truncatedEndpoint = endpoint.substring(0, 15) + "..." + endpoint.substring(endpoint.length() - 15);
}

String endpointMethod = jiraMetaData.getTestingIssueId().getApiInfoKey().getMethod().name();

// issue title
fields.put("summary", "Akto Report - " + jiraMetaData.getIssueTitle());
fields.put("summary", "Akto Report - " + jiraMetaData.getIssueTitle() + " (" + endpointMethod + " - " + truncatedEndpoint + ")");
jiraIntegration = JiraIntegrationDao.instance.findOne(new BasicDBObject());

// issue type (TASK)
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/src/main/java/com/akto/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -621,5 +621,4 @@ public static List<String> getUniqueValuesOfList(List<String> input){
input.addAll(copySet);
return input;
}

}

0 comments on commit c5d3957

Please sign in to comment.