Cireson Partners, Customers and Community members share your customizations and examples here to help benefit the community as a whole to earn Kudos and badges.
DISCLAIMER
All files and projects located here are provided and come "as-is" and without any warranty or support. Use at your own risk. Your use of Community Uploads is subject to our Terms of Use.
Cireson does not and will not support or maintain these enhancements, extensions, and scripts.
For Team Cireson uploads click here.
Add Activity Task
Features
This task is based on Cireson's "Portal add MA to SR Task" with new features:
- Add Manual, Review, Sequential or Parallel activity
- Compatible with Service Requests, Incidents, Change Requests and Release Record
- Activity Templates
- Different templates for each activity types
- Copy parent title & description template
No duplicate code for the different work item or activity types. I've reused the same code and functions so that it can stays as short and easy to modify as possible.
It is still possible to add the activity within the parallel activity.
Installation:
Copy the AddActivity.js file to your CiresonPortal\CustomSpace folder.
Copy the AddActivity.html file to your CiresonPortal\CustomSpace folder.
Copy the custom.js contents into your CiresonPortal\CustomSpace\custom.js file.
Setting up templates:
The templates are defined in the AddActivity.js file at Line 81. I've removed my templates from the files but I've kept some examples, including the "Copy parent title & description".
To add a template, copy one of the example template and change the values.
Type: Add the Activity Prefix ("MA","RA","PA","SA") for which you want this template to appear for.
TemplateName: The name of the template that will appear in the template dropdown menu.
TemplateTitle: The title used by the template; what will show as the predefined title once the user select it.
TemplateDescription: The predefined description. You may need to use escape characters. For example, use \n for line returns.
Features to add:
I would love to be able to add the activity implementer for Manual Activity directly from the window (instead of having to add the activity and the implementer in two steps). Also, support for multi-level activities would be great.
If someone from the community knows how we could do this, it would be a great addition!
Please test in your test environment first!
Download the attached .zip file below
Comments
If you replace the section at line 17 to 22 for the following, the task would now also appear and work for "Submitted" service requests:
I have implemented this with the code above swapped. When I am creating a new SR, I do not have the Add Activity. After saving the SR and opening it again I do have the Add Activity. In my environment, It looks like to me that when a SR is created it is in a status of "NEW" and not "submitted".
Did you get this to work when creating a new SR?
You can try the code below instead, it will show the task for all status except for Failed and Cancelled.
Using the task on a new SR will commit (save) the ticket. I didn't have enough time to fully test this but it should work.
Thank you, here are my results. If I just try to add the activity when creating I get this message:
If I click Cancel it moves to the shaded screen that says "adding Activity" and gets stuck.
If I click Leave it adds the activity and looks normal.
If I click apply before attempting to add the activity it does not display the above message and adds the activity normally.
Is there a way to force it to "apply" when you select the Add Activity so that I don't get the above message?
I have a need to have a templated activity that is added to the end of each activity sequence. Unfortunately the default behavior doesn't let you add an activity before the first activity. To address this, I added a dummy activity entry. The entry only shows up if the activity isn't in progress as that will cause workflow orphans. Bold is my new code.
// Create Activity Dropdown values that start with the Activity In Progress
var activities = [];
if(startpos == 0) {
activities.push({
"SequenceId": -1,
"Title": "Beginning"
});
}
A second issue is that it will cause an error if an activity is added before the parent work item is saved. This is likely caused by my need to display in multiple statuses but if you have this problem you can add a test for last mod date which indicates it has been committed at least once.
if(!(pageForm.viewModel.Status.Id.match("6188d6de-d719-5b6a-d700-a2a34316bcae"|"a52fbc7d-0ee3-c630-f820-37eae24d6e9b"))|(pageForm.viewModel.LastModifiedBy == null)){$( ".taskmenu li:contains('Add Activity')" ).hide();}
if(!session.user.Analyst) {$( ".taskmenu li:contains('Add Activity')" ).hide();}
Both of these are probably edge cases so not needed for everyone.
Again, thanks for the great work.
I replaced viewModel by a GetProjection and activities added into Parallel Activity and now saving properly. I also fixed some bugs with status, Sequence Id and ActualStartDate for activity added "In Progress".
@Joakim_Normann
Thanks for this! I was wondering if it would be possible to add a field to assign an Activity Implementer during the creation dialog?
We recently upgraded to 9.3.10.2016 and it seems like there is an issue with adding MA to PAs. When I look in the developer console the following error code is listed:
Uncaught TypeError: Cannot read property 'Status' of undefined
at addActivityWI (<anonymous>:261:62)
at init.okClick (<anonymous>:162:5)
at i (jquery.min.js:2)
at init.handlers.<computed> (kendo.all.min.js:29)
at init.trigger (kendo.all.min.js:25)
at init._click (kendo.all.min.js:37)
at HTMLButtonElement.i (jquery.min.js:2)
at HTMLButtonElement.dispatch (jquery.min.js:2)
at HTMLButtonElement.y.handle (jquery.min.js:2)
Are there any changes that we can make to fix this issue?
When I add activity my workflow is stopping and next activity after add stuck in pending, how I can fix this?
We just accidentally upgraded ours to version 9.6.0 (9.4.2 was the Latest version when I downloaded it), and this version broke the ascending order of the newly added MAs within the PA of a CR. Please help!
--PA870711
----MA870712 existing MA
----MA870776 new MA2
----MA870781 new MA3
----MA870727 new MA1
@Carol_Lee what's wrong with your example? You cannot expect MAIDs to be sequence of numbers. IDs are incremented with each created work item so if you created MA870727, then set of any SR/CR/MA/PA/SA/RA/... getting next numbers in row and then created new MA it could get ID MA870776 instead of MA870728.
Activities in parallel activity (PA) are executed in parallel so their IDs/order doesn't matter.
Tested in 9.6.0 in lab environment and Add Activity Tasks works without problems.
@Peter_Miklian so, the order that the new MAs are located does not matter? As long as the sequence numbers are in order then it is fine?
Yes Carol, that is correct. As long as sequence numbers are in order for the ticket, it doesn't matter what the MA ID numbers are (sequence IDs are generated and changed automatically and can be found in the history of a work item)
Yes, it's SequenceId what defines order of activities in parent Work Item (SR/CR/SA), not their Name, Displayname or ID and in PA (Parallel Activity) all run in parallel.
SequenceId = 0 for the firs activity. If you change order of activities in SCSM console by drag&drop, their SequenceId should change.
You can see all properties of MA using PowerShell:
Noted with thanks @Tony_Collett @Peter_Miklian
Same question answered by @Adam_Dzyacky here: https://community.cireson.com/discussion/5259/scsm-auto-number-ir-not-sequencial
Hi Team, say me please how I can add template. I have two template for Review Activity, but in this feature show only one template "Default Review Activity" how I can show all my template for RA.
When the cahebuilder sync again then it should be there
strange, the cachebuilder worked, but the template is still one
What about after a app pool recycle and restarting your browser?