Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt | ||
---|---|---|
| ||
Routines Functions focused on your Jira Service Management tasks like adding a comment, checking if a comment is public or private, and so on. |
Child pages (Children Display) | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Jira Service Management Structures
Below you’ll find the fields of the structures and some examples for each of them to get you an idea of what it is and what it does.
Expand | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
JSlaInformation
JSlaCompletedCycle
JSlaOngoingCycle
Example 1 - getting the information from SLA customfield
Example 2 - getting the information from getSlaInformation |
function
|
Expand | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
JSMCustomerRequest
JSMCustomerRequestActions
JSMCustomerRequestStatus
Example 1 - get customer request with key/id
|
Example 2 - get only the statuses in which a customer request was
|
Expand | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
JSMApproval
JSMApprover
Example 1 - getting all approvals for the request provided
Example 2 - getting Approval by id
|
Expand | ||||
---|---|---|---|---|
| ||||
JSMAttachment
Example
|
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
JSMComment
Example 1 - get all (or just public / private) comments for request
Example 2 - get comment with a provided id from request
|
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
JSMServiceDesk
Example 1 - get all service desks
Example 2 - get service desk for project
|
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
JSMQueue
Example 1 - get all queues for a service desk
Example 2 - get queue by id from service desk
|
Expand | ||
---|---|---|
| ||
JSMAssetsObject
Example |
- get assets objects from custom field
|
Expand | ||
---|---|---|
| ||
JSMKBArticle
|
Example - get articles that contains the word “template” as a searchQuery
|
Expand | ||||
---|---|---|---|---|
| ||||
JSMRequestType
Example - get all request types
|
Expand | ||||
---|---|---|---|---|
| ||||
JSMFeedback
Example - get feedback for request
|
General Example For (some of the) Functions
Code Block |
---|
string customerEmail = "icecream@testBuyer.com"; boolean customerCreated = createCustomer("The Ice Cream Buyer", customerEmail); if(customerCreated) { runnerLog("A new customer was invited, let's announce this on the ticket."); addJSDComment(key, "We invited the customer with the following email '" + customerEmail +"' to join us.", true); //public comment } else { addJSDComment(key, "We couldn't invite the customer with the following email '" + customerEmail +"' please take a second look.", false); //internal comment } int[] commentsIds = getAllCommentIds(key); runnerLog("There are '" + size(commentsIds) + "' comments with the following ids: " + commentsIds); string newOrgName = "iFixit"; createOrganization(newOrgName); int propsOrgId = getOrganizationIdByName(newOrgName); runnerLog("We should add the new organization to a JSM project."); addOrganization({"Org", newOrgName}, "JSM"); runnerLog("Let's add some engineers to the newly created organization"); addCustomerToOrganization({"customer_id", "another_customer_id"}, newOrgName); runnerLog("Engineers from organization '" + newOrgName + "': " + getUsersFromOrganizations({newOrgName})); runnerLog("Remove one of them."); removeCustomerFromOrganization({"customer_id"}, newOrgName); runnerLog("Now we have the following engineers: " + getUsersFromOrganizations({newOrgName})); runnerLog("Let's set some properties for a new organization"); setOrganizationPropertyValue(propsOrgId, "DoesItWork", false); setOrganizationPropertyValue(propsOrgId, "IceCreamType", {"McSUNDAE", "McFlurry"}); runnerLog("What properties do we have set on the organization with id " + propsOrgId + "? "); string[] properties = getOrganizationPropertyKeys(propsOrgId); runnerLog("Properties: "+ properties); for(string prop in properties) { runnerLog("Property with key '" + prop + "' has value: " + getOrganizationPropertyValues(propsOrgId, prop)); } runnerLog("Let's put one of the engineers to work."); setOrganizationPropertyValue(propsOrgId, "DoesItWork", true); runnerLog("The new value of 'DoesItWork' is: " + getOrganizationPropertyValues(propsOrgId, "DoesItWork")); runnerLog("Looks like the engineer did a good work."); runnerLog("Since the ice cream machine is working, let's remove the second property."); deleteOrganizationProperty(propsOrgId, properties[0]); runnerLog("Now we only have the following properties: " + getOrganizationPropertyKeys(propsOrgId)); runnerLog("How many organization are associated with project 'JSM': " + size(getAllOrganizationIds("JSM"))); runnerLog("Let's remove the newly created organization from the 'JSM' project."); removeOrganization({newOrgName}, "JSM"); runnerLog("Now we have only '" + size(getAllOrganizationIds("JSM")) + "' organizatons on the project JSM"); runnerLog("Let's get rid of the new organization since we don't use it anymore."); //we'll get the organizationsIds before and after the delete of the organization and get the diff to check if the organization was really deleted int[] initialOrganizations = getAllOrganizationIds(); deleteOrganization(newOrgName); int[] currentOrganizations = getAllOrganizationIds(); string[] deletedOrgs = arrayDiff(initialOrganizations, currentOrganizations); if(size(deletedOrgs) == 1 && deletedOrgs[0] == propsOrgId) { runnerLog("Organization with name: '" + newOrgName + "' does not exist anymore"); } return "Have a nice day."; |