/*
* Example script that modifies a social contact
*
* This script will demonstrate the modification of a social contact.
* For the full list of script filter fields, see -> https://cvp/display/ccpdev/Filter+Script+API
*/
//Set the author
socialContact.author = "John Doe"
//Set the title
socialContact.title = "New Title"
//Set the description
socialContact.description = "This is a socialContact"
//Set the categories. Takes a list of strings.
socialContact.categories = ["category_1", "category_2", "category_3"]
//Set the tags. Alternatively, you can use the Java syntax as well.
//NOTE: duplicate tags will be removed when the socialContact is saved.
//NOTE: setting tags like so will replace any existing tags.
// to append tags see below.
socialContact.tags = ["tag1", "tag1", "tag2"]
//Append new_tag to tags
def tags = socialContact.tags;
tags += "tag3"
socialContact.tags = tags;
//A shorter way
socialContact.tags.add("tag4")
//Alternatively,
socialContact.tags += "tag5"
//Or even
socialContact.tags += ["tag6", "tag7"]
//Log the author, title, description, categories, and tags using getter methods.
log "Author is " + socialContact.author //should be "John Doe"
log "Title is" + socialContact.title //should be "New Title"
log "Description is " + socialContact.description //should be "This is a socialContact"
log "Categories are" + socialContact.categories //should be["category_1","category_2","category_3"]
log "Tags are" + socialContact.tags //should be [ "tag1", "tag1", "tag2", "tag3", "tag4", "tag5",
"tag6", "tag7"]
//however, keep in mind that duplicates will be removed when saved
//Finally, return