I have the following scenario: when an approver approves an issue, I have a post function that creates one or more subtasks and one or more issues of another type. I have a "Single Issue Picker" custom field on the other issue type. As I iterate through, I create a subtask and then the other issue, and I then attempt to place the subtask reference in the Single Issue Picker on the other issue. I get the following error when I attempt to do so:
customfield_13400:Issue: TIS-1028 does not fit filter query:
customfield_13400 is the Single Issue Picker field, and TI-1028 is the subtask that I just created. I have no JQL on the Single Issue Picker field, so any issue should be a valid value.
I can go in through the UI and set the field as I wish (e.g. I can go into that issue right now and set the field to TIS-1028, and it saves just fine).
I can also update the issue through the script console using the same code that I use in my post function.
I can also hard-code a previously attempted (and failed) subtask reference in the code in the post function.
It appears that the subtask is not fully stored or indexed, thus preventing me from referencing it in this field. I CAN, however, immediately reference it and create a link to/from it.
I've got an open ticket with Atlassian, but I'm not really getting anywhere with it, so I wanted to see if anyone in the Community has encountered a similar situation.
Thanks!
I tried several different orders on the post functions and also tried manually indexing, all to no avail. I finally threw in the towel and changed from a Single Issue Picker to a text field. Not as tight an integration as I would like, but it works. The field is programmatically set and never edited, so there is no concern about integrity.
-Payne
What is the order of execution for all your post-functions?
Are you using the built-in create-subtask post function?
It would be helpful to understand how all your pieces come together to come up with some ideas.
A bit of assumption here... but I would guess that if you have the issue key available during the post function... then the new issue has been stored. But perhaps it hasn't been indexed yet.
So maybe adding a manual indexing of the subtask before attempting to set the issue picker value might help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Having the same issue myself, @Payne did you find a resolution to your issue?
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.AttachmentManager
import com.atlassian.jira.user.ApplicationUser
import org.apache.log4j.Logger
import org.apache.log4j.Level
Logger jiraLog = Logger.getLogger(this as String)
jiraLog.setLevel(Level.DEBUG)
Issue sourceIssue = issue
sourceIssue.refresh().reindex()
Issue destinationIssue
ApplicationUser issueApprover // Added these, so we can reference it throughout the Class Methods
String approvalDate
AttachmentManager attachmentManager = ComponentAccessor.getAttachmentManager()
UserAccounts userAccounts = new UserAccounts()
jiraLog.debug('Source Issue: ' + sourceIssue.getKey())
//List<Approval>
def approvals = sourceIssue.getApprovals()
jiraLog.debug(approvals[0].getClass())
approvals.each { approval ->
if (approval.getDecision()) {
jiraLog.info("Approval Decision: ${approval.getDecision().get().decision}")
jiraLog.info("Approved Date UTC: ${approval.getDecision().get().completedDate}")
//approvalDate = approval.getDecision().get().completedDate.toString() // Set Approval, As String?
approval.getApprovers().each{ approver ->
approver.getApproverDecision()
if (approver.getApproverDecision()) {
if (approver.getApproverDecision().get().name() == 'APPROVED') {
jiraLog.info("Approved By User: " + approver.approverUser.getDisplayName())
issueApprover = approver.approverUser // Set Issue Approver
}
} else {
//jiraLog.info("No Response From: " + approver.approverUser.getName())
}
}
} else { jiraLog.debug('Approval Still Pending') }
}
//Create OPS Issue
destinationIssue = Issues.create('OPS','Service Request' ) {
setSummary(sourceIssue.getSummary() + ' Approved By: ' + issueApprover.getDisplayName() )
setReporter(sourceIssue.getReporter())
setLabels('Ops-Access-Request')
setRequestType('Request')
//Check Source Issue for installations
if (sourceIssue.getCustomFieldValue('Installations - Unknown')){
setCustomFieldValue('Installations - Unknown',sourceIssue.getCustomFieldValue('Installations - Unknown'))
}else if (sourceIssue.getCustomFieldValue('Installations')){
setCustomFieldValue('Installations'){
sourceIssue.getCustomFieldValue("Installations").each { intObject->
add(intObject.getObjectKey())
}
}
}
setCustomFieldValue('Handed Over From', sourceIssue.getKey())
}
jiraLog.debug('Handed Over To Issue: ' + destinationIssue.getKey() )
attachmentManager.copyAttachments(sourceIssue,Users.getLoggedInUser(),destinationIssue.getKey())
destinationIssue.refresh().reindex()
sourceIssue.refresh().reindex()
sourceIssue.refresh().transition('Handover'){
transitionOptions { skipConditions() }
//setCustomFieldValue('Handed Over To', destinationIssue.refresh().getKey())
}.addComment('Issue Has Been Handed Over, Issue ' + destinationIssue.getKey() + ' Has been raised in the ' + destinationIssue.getProjectObject().key + ' Project.'){internal()}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.