Hi there,
Could someone please tell me what JQL query to use in order hide issues that have been marked done for more than 31 days?
Thank you :)
Hello @luanlopes94
How exactly you create issue? Can you provide code
For example:
def projectid = ComponentAccessor.getProjectManager().getProjectByCurrentKey("DS").getId()
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
IssueService issueService = ComponentAccessor.getIssueService()
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
issueInputParameters.setProjectId(projectid)
.setIssueTypeId("10107")
.setSummary("This is a summary")
.setReporterId(user.key)
.setAssigneeId(user.key)
.setDescription("I am a description")
.setStatusId("1")
.setPriorityId("2")
log.error("Input params: {}", issueInputParameters)
IssueService.CreateValidationResult createValidationResult = issueService.validateCreate(user, issueInputParameters);
log.error("Validation?: {}", createValidationResult.isValid().toString())
if (createValidationResult.isValid())
{
IssueService.IssueResult createResult = issueService.create(user, createValidationResult);
log.error("Creation result?: {}", createResult.isValid().toString())
if (!createResult.isValid())
{
log.error("Something went wrong")
}
}
Hello Mark,
Sorry for my late reply. There is my code:
issueInputParameters
.setProjectId( issue.getProjectObject().getId() )
.setSummary( sum )
.setDescription("test desc")
.setIssueTypeId(issueTypeID)
.setPriorityId(issue.priorityId)
.setReporterId(issue.reporterId)
.setAssigneeId(issue.assigneeId)
log.error("issueInputParameters: " + issueInputParameters.getSummary())
log.error("getCustomField do issueInputParam: " + issueInputParameters.getCustomFieldValue("customfield_10301"))
ApplicationUser user = (ApplicationUser) ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
CreateValidationResult createValidationResult =
issueService.validateCreate(user, issueInputParameters)
issueInputParameters.setSkipScreenCheck(true)
log.error("issue input parameters: " + issueInputParameters.getCustomFieldValue("customfield_10301"))
log.error("User: " + ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser())
log.error(createValidationResult.getErrorCollection())
log.error("Validation?: " + createValidationResult.isValid().toString())
if (createValidationResult.isValid())
{
log.error("i am in createValidationResult")
log.error("will be created")
IssueResult createResult = issueService.create(
user, createValidationResult)
log.error("Creation result?: {}", createResult.isValid().toString())
log.error("created ")
log.error("DESCRIPTION OF CREATED ISSUE: " + createResult.getIssue().getDescription())
if (!createResult.isValid())
{
log.error("Error while creating the issue.")
}
}
else
{
String cause = StringUtils.join(createValidationResult.getErrorCollection().getErrorMessages(), "/")
log.error("cause :" + cause)
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where did you set customfield value in issueinputparameters?
It should be like this
issueInputParameters.setProjectId(projectid)
.setIssueTypeId("10107")
.setSummary("This is a summary")
.setReporterId(user.key)
.setAssigneeId(user.key)
.setDescription("I am a description")
.setStatusId("1")
.setPriorityId("2")
.addCustomFieldValue("customfiled_10111", "test")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I used this:
issueInputParameters
.setProjectId( issue.getProjectObject().getId() )
.setSummary( sum )
.setDescription("test desc")
.setIssueTypeId(issueTypeID)
.setPriorityId(issue.priorityId)
.setReporterId(issue.reporterId)
.setAssigneeId(issue.assigneeId)
.addCustomFieldValue( cf_ModelName_field, cf_ModelName.toString())
.addCustomFieldValue( cf_ReleaseType_field, cf_ReleaseType.toString())
.addCustomFieldValue( cf_ModelCategory_field, cf_ModelCategory.toString())
.addCustomFieldValue( cf_Organization_field, cf_Organization)
.addCustomFieldValue( cf_SIMCard_field, cf_SIMCard)
And for the custom fields values I used it:
/** Model Name - customfield_10301 **/
String cf_ModelName = issue.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_10301"))
Long cf_ModelName_field = 10301L
log.error("cf_ModelName: " + cf_ModelName)
...
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.