Snippets

Adaptavist Set Single User-Picker cf

Updated by Joaquin Fernandez

File snippet.txt Modified

  • Ignore whitespace
  • Hide word diff
 // specify the issue key here for the issue to update
 def issueKey = "issue key"
-// Specify the id for the Request Participants field here
+// Specify the id for the user picker custom field here
 def userPickerField = "customfield_XXX"
-// specify the account ID of the user to add as a request particaipant here
+// specify the account ID of the user to add 
 def userAccountId = "XXXXXXXXXXXX"
 def result = put("/rest/api/2/issue/${issueKey}") 
 .header('Content-Type', 'application/json') 
Updated by Joaquin Fernandez

File Set Single User-Picker cf Deleted

  • Ignore whitespace
  • Hide word diff
-// specify the issue key here for the issue to update
-def issueKey = "issue key"
-// Specify the id for the Request Participants field here
-def userPickerField = "customfield_XXX"
-// specify the account ID of the user to add as a request particaipant here
-def userAccountId = "XXXXXXXXXXXX"
-def result = put("/rest/api/2/issue/${issueKey}") 
-.header('Content-Type', 'application/json') 
-.body([
-fields:[
-(userPickerField): [id: userAccountId]
-]
-])
-.asString()

File snippet.txt Added

  • Ignore whitespace
  • Hide word diff
+// specify the issue key here for the issue to update
+def issueKey = "issue key"
+// Specify the id for the Request Participants field here
+def userPickerField = "customfield_XXX"
+// specify the account ID of the user to add as a request particaipant here
+def userAccountId = "XXXXXXXXXXXX"
+def result = put("/rest/api/2/issue/${issueKey}") 
+.header('Content-Type', 'application/json') 
+.body([
+fields:[
+(userPickerField): [id: userAccountId]
+]
+])
+.asString()
Created by Joaquin Fernandez

File Set Single User-Picker cf Added

  • Ignore whitespace
  • Hide word diff
+// specify the issue key here for the issue to update
+def issueKey = "issue key"
+// Specify the id for the Request Participants field here
+def userPickerField = "customfield_XXX"
+// specify the account ID of the user to add as a request particaipant here
+def userAccountId = "XXXXXXXXXXXX"
+def result = put("/rest/api/2/issue/${issueKey}") 
+.header('Content-Type', 'application/json') 
+.body([
+fields:[
+(userPickerField): [id: userAccountId]
+]
+])
+.asString()
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.