In the scenario where a user exists in Confluence, and not in JIRA, how can that user view a JIRA Team Calendar?
I currently have the JIRA Application Link set to Trusted Authentication. In this scenario, do I need to change the Application Link to use basic authentication so all data is proxied through a single account?
If so, it would then seem that all activity over the application link from Confluence to JIRA would then no longer be subject to JIRA permissions... and that could be undesirable.
Thank you for any feedback you might have.
Why are you using the REST api to create the issue?
You're already in the java layer, why don't you create the issue using the Java api?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.link.IssueLinkTypeManager
def issueService = ComponentAccessor.issueService
def projectManager = ComponentAccessor.projectManager
Issue issue
def iip = issueService.newIssueInputParameters()
iip.setApplyDefaultValuesWhenParameterNotProvided(true)
iip.setSkipScreenCheck(true)
def issueType = ComponentAccessor.constantsManager.getIssueType('Task')
iip.projectId = projectManager.getProjectObjByKey('ATT').id
iip.issueTypeId = issueType.id
iip.priorityId = issue.priority.id
iip.summary = issue.summary
iip.description = issue.description
iip.addCustomFieldValue 'customfield_10500', 'Cross'
def currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def validationResult = issueService.validateCreate(currentUser, iip)
if(!validationResult.valid){
log.error "Error validating issue input parameters: $validationResult.errorCollection"
return
}
def creationResult = issueService.create(currentUser, validationResult)
if(!creationResult.valid){
log.error "Error creating issue: $creationResult.errorCollection"
return
}
def issueLinkManager = ComponentAccessor.issueLinkManager
def issueLinkTypeManager = ComponentAccessor.getComponent(IssueLinkTypeManager)
def linkType =issueLinkTypeManager.getIssueLinkTypesByName('Orquestrador')[0]
issueLinkManager.createIssueLink(issue.id, creationResult.issue.id, linkType.id, 0, currentUser)
hi @PD Sheehan
Sorry for the delay, I didn't think you would respond so quickly here!!
I hadn't thought of that...
It really could be done that way.
Would you know how I would have to insert more than one value in the customfield_10500 field (it being a checkbox)
I believe you have to use the ID instead of the value, but I don't know how it would look when you have more than one option selected
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Correct, if the custom field is a checkbox, you have to find the option and add the id (as a string).
It is possible to have multiple.
For example:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.context.IssueContext
import com.atlassian.jira.issue.context.IssueContextImpl
import com.atlassian.jira.issue.link.IssueLinkTypeManager
def issueService = ComponentAccessor.issueService
def projectManager = ComponentAccessor.projectManager
Issue issue
def iip = issueService.newIssueInputParameters()
iip.setApplyDefaultValuesWhenParameterNotProvided(true)
iip.setSkipScreenCheck(true)
def issueType = ComponentAccessor.constantsManager.getIssueType('Task')
def project = projectManager.getProjectObjByKey('ATT')
iip.projectId = project.id
iip.issueTypeId = issueType.id
iip.priorityId = issue.priority.id
iip.summary = issue.summary
iip.description = issue.description
def optionValueList = ['Cross', 'Banana']
def cfObject = ComponentAccessor.customFieldManager.getCustomFieldObject('customfield_10500')
def config = cfObject.getRelevantConfig(new IssueContextImpl(project,issueType) )
def options = ComponentAccessor.optionsManager.getOptions(config).findAll{it.value in optionValueList}
iip.addCustomFieldValue 'customfield_10500', options.collect{it.optionId as String} as String[]
def currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def validationResult = issueService.validateCreate(currentUser, iip)
if(!validationResult.valid){
log.error "Error validating issue input parameters: $validationResult.errorCollection"
return
}
def creationResult = issueService.create(currentUser, validationResult)
if(!creationResult.valid){
log.error "Error creating issue: $creationResult.errorCollection"
return
}
def issueLinkManager = ComponentAccessor.issueLinkManager
def issueLinkTypeManager = ComponentAccessor.getComponent(IssueLinkTypeManager)
def linkType =issueLinkTypeManager.getIssueLinkTypesByName('Orquestrador')[0]
issueLinkManager.createIssueLink(issue.id, creationResult.issue.id, linkType.id, 0, currentUser)
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.