I have tried it all! I have scoured the interwebs to no avail. I have a project role consisting of multiple users and I need to load those users into a multi-user custom field. The most straightforward way it seems is from a Jira Group instead of project roles, I am good with either. This is the code I have found for the group into custom field.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
def groupManager = ComponentAccessor.getGroupManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def myJiraGroup = groupManager.getGroup("Jira Group name") // get the group
def usersInGroup = groupManager.getUsersInGroup(myJiraGroup) // get the users in that group
def myCustomField = customFieldManager.getCustomFieldObjectsByName("Custom multi-user field")
myCustomField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(myCustomField), usersInGroup), new DefaultIssueChangeHolder()) // update myCustomField with users
It throws an error "No signature of method:" but the details get cut off before I can read what parameter is hosed.
TIA
I'd recommend you ask them directly from their JSD portal: https://productsupport.adaptavist.com/servicedesk/customer/portals
From what I can tell, I think you are right that the public API is lacking a PUT option to just add test cases.
But if you feel adventurous (and the fine adaptavist folks may not like what I'm about to tell you), you can examine the calls made by your browsers when you add test cases to an existing test run. You will see that it's possible to PUT to /rest/tests/1.0/testrunitem/bulk/save.
Notes:
The payload looked like this when I added 2 test to a run that already had 2:
{
"testRunId":12677,
"addedTestRunItems":[
{"index":0,"lastTestResult":{"testCaseId":24219,"assignedTo":"p6s"}},
{"index":1,"lastTestResult":{"testCaseId":24214,"assignedTo":"p6s"}}
],
"updatedTestRunItems":[],
"updatedTestRunItemsIndexes":[
{"id":304535,"index":2},
{"id":304534,"index":3}
],
"deletedTestRunItems":[]
}I suspect you can omit the updatedTestRunItemsIndexes if you add your new test cases with new index numbers (rather than at the top like this did).
This non-public API, in my experience, can be used with that same authentication as the public one.
Of course, they are not guaranteed to be consistent from version to version since they are designed to be used internally by the app. So if you have problems with it, then Adaptavist support may not be willing to help you.
Thank you so much Peter ... Will try the JSD portal ...
yes, have tried inspect, found the same one as you have mentioned... when I have tried adding to existing RUN, it was adding only one test case though my pay load was more than one... I couldn't continue on this since it was non-public api and as you too mentioned, there wont be support if they deprecate it later in future...
will try my luck with JSD portal :-) ..
Thanks once again
Cheers
skumar
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.