Search in sources :

Example 6 with CreateWorkItemAttr

use of com.checkmarx.flow.dto.azure.CreateWorkItemAttr in project cx-flow by checkmarx-ltd.

the class IssueRequestBuilder method getTags.

private CreateWorkItemAttr getTags(String projectName, String organizationName) {
    CreateWorkItemAttr result = new CreateWorkItemAttr();
    result.setOp("add");
    result.setPath("/fields/Tags");
    String tags = String.format("CX,owner:%s,repo:%s,branch:%s", organizationName, projectName, AzureDevopsClient.DEFAULT_BRANCH);
    result.setValue(tags);
    return result;
}
Also used : CreateWorkItemAttr(com.checkmarx.flow.dto.azure.CreateWorkItemAttr)

Example 7 with CreateWorkItemAttr

use of com.checkmarx.flow.dto.azure.CreateWorkItemAttr in project cx-flow by checkmarx-ltd.

the class IssueRequestBuilder method getEntityBodyForCreation.

public List<CreateWorkItemAttr> getEntityBodyForCreation(Issue issue, String projectName, String organizationName) {
    CreateWorkItemAttr title = getTitle(issue);
    CreateWorkItemAttr description = getDescription(issue);
    CreateWorkItemAttr state = getState(issue.getState());
    CreateWorkItemAttr tags = getTags(projectName, organizationName);
    return Arrays.asList(title, description, state, tags);
}
Also used : CreateWorkItemAttr(com.checkmarx.flow.dto.azure.CreateWorkItemAttr)

Example 8 with CreateWorkItemAttr

use of com.checkmarx.flow.dto.azure.CreateWorkItemAttr in project cx-flow by checkmarx-ltd.

the class IssueRequestBuilder method getDescription.

private CreateWorkItemAttr getDescription(Issue issue) {
    CreateWorkItemAttr description = new CreateWorkItemAttr();
    description.setOp("add");
    description.setPath("/fields/System.Description");
    description.setValue(issue.getBody());
    return description;
}
Also used : CreateWorkItemAttr(com.checkmarx.flow.dto.azure.CreateWorkItemAttr)

Example 9 with CreateWorkItemAttr

use of com.checkmarx.flow.dto.azure.CreateWorkItemAttr in project cx-flow by checkmarx-ltd.

the class IssueRequestBuilder method getTitle.

private CreateWorkItemAttr getTitle(Issue issue) {
    CreateWorkItemAttr title = new CreateWorkItemAttr();
    title.setOp("add");
    title.setPath("/fields/System.Title");
    title.setValue(issue.getTitle());
    return title;
}
Also used : CreateWorkItemAttr(com.checkmarx.flow.dto.azure.CreateWorkItemAttr)

Aggregations

CreateWorkItemAttr (com.checkmarx.flow.dto.azure.CreateWorkItemAttr)9 PullRequestReport (com.checkmarx.flow.dto.report.PullRequestReport)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 JSONObject (org.json.JSONObject)1 HttpEntity (org.springframework.http.HttpEntity)1