Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Customization
- 세레나소프트웨어
- Continuous Integration
- SharePoint
- Dimensions CM
- CM Bridge
- UseCase
- Serena software
- integration
- build
- Dimensions Pulse
- Jenkins
- 버전관리
- CM14
- 엔터프라이즈 SCCM
- TeamTrack
- IntelliJ IDEA
- Enterprise Software Change and Configuration Management
- Embracing OpenSource
- SCCM
- Software Change and Configuration Management
- SBM
- 소스코드관리
- AppScript
- Stream
- DIM14
- teamscript
- Serena Dimensions CM
- BPM
- CKEditor
Archives
- Today
- Total
this and that
SBM AppScript Use Cases - 03. Auto-Subtasks for Assessors 본문
한번의 트랜지션으로 선택된 Assessors 에 대한 Subtask를 자동으로 일괄 생성한다.
새로운 워크플로우로는 Post-Transition script를 사용한 Regular Transition을 이용한다.
선택된 Assessors를 알아낸다.
선택된 각 Assessor를 위해 새로운 Taks 아이템을 생성한다. 그리고 다음과 같이 필드를 매핑한다.:
• Title and Description copied from Widget Change Request
• Item Type to Task
• Task Owner to the Assessor
• Owner to the Assessor
• Parent Widget CR to the TS_ID of the Widget Change Request item
• Submit Date to now
• Submitter to Tech Lead making the transition
• Last State Changer to Tech Lead
• Last State Change Date to now
• Last Modifier to Tech Lead
• Last Modified Date to now
• State to New (from Task workflow)
• Close Date to null
원래의 Widget Change Request에서 새롭게 생성된 Task 아이템들을 Child Tasks 필드로 지정한다.
주의: 해당 Transition을 여러번 실행하더라도 각 Assessor에게는 오직 하나의 subtask만 갖도록 해야한다.
새로운 워크플로우로는 Post-Transition script를 사용한 Regular Transition을 이용한다.
선택된 Assessors를 알아낸다.
선택된 각 Assessor를 위해 새로운 Taks 아이템을 생성한다. 그리고 다음과 같이 필드를 매핑한다.:
• Title and Description copied from Widget Change Request
• Item Type to Task
• Task Owner to the Assessor
• Owner to the Assessor
• Parent Widget CR to the TS_ID of the Widget Change Request item
• Submit Date to now
• Submitter to Tech Lead making the transition
• Last State Changer to Tech Lead
• Last State Change Date to now
• Last Modifier to Tech Lead
• Last Modified Date to now
• State to New (from Task workflow)
• Close Date to null
원래의 Widget Change Request에서 새롭게 생성된 Task 아이템들을 Child Tasks 필드로 지정한다.
주의: 해당 Transition을 여러번 실행하더라도 각 Assessor에게는 오직 하나의 subtask만 갖도록 해야한다.
' Name: createSubtasks ' Function: Read each Assessor chosen in the Assessors multi-user ' field and create a new Task item in the Issues table the assessor. ' Context: Post-transition for Pick Assessors transition ' ' Date: 03/09/2006 ' For use in the TeamTrack TeamScript course examples. ' Require all vars to be declared before use (and then declare some) Option Explicit ' Multi-user field containing the owners of the sub-tasks Const USER_LIST_FLD = "ASSESSORS" ' Field in Parent workflow containing links to sub-tasks Const SUBTASK_FLD = "CHILD_TASKS" ' Field in sub-task workflow containing link to parent Const CHILD_SUBTASK_FLD = "PAREN_WIDGET_CR" ' Ownership field of the initial state in sub-task workflow Const TASK_OWNER_FLD = "TASK_OWNER" ' Item type field and the value to set it to... Const ITEM_TYPE_FLD = "ISSUETYPE" Const TASK_TYPE = 314 ' Sub-task project ID, table ID, and initial state ID Const PROJECT_ID = 31 Const CHILD_TABLE_ID = 1000 Const NEWSTATEID = 70 Dim objItem, objFields, objField, objNewItem Dim strTitle, strDescription, strAssessors, strAssessor Dim strSubtasks ' Get the current item Set objItem = Shell.Item ' Read title, description, and assessor fields Set objFields = objItem.Fields() Set objField = objFields.FindField(USER_LIST_FLD) objField.GetValue strAssessors Set objField = objFields.FindField("TITLE") objField.GetValue strTitle Set objField = objFields.FindField("DESCRIPTION") objField.GetValue strDescription ' Find out if there are any assessors. An empty field is "," otherwise it is a comma ' separated list of user ids with leading and trailing commas. If strAssessors <> "," Then Dim nStart, nEnd, nId, nLength, nNewId, strNewIds nStart = 2 nLength = Len(strAssessors) nEnd = nStart ' Call Ext.LogInfoMsg("Assessors: "&strAssessors&" nEnd "&nEnd&" Len "&nLength) do while nStart <= nLength 'Use VB like functions to parse the list of users nEnd = InStr(nStart,strAssessors,",") nId = Mid(strAssessors, nStart, nEnd - nStart) nNewId = CreateSubtask(nId, strTitle, strDescription) ' Call Ext.LogInfoMsg("Id: "&nId) strNewIds = strNewIds & nNewId & "," nStart = nEnd + 1 Loop 'update the current record with the newly created subtask Set objField = objFields.FindField(SUBTASK_FLD) objField.GetValue strSubtasks If strSubtasks = ",," then strSubtasks = "," End If strSubtasks = strSubtasks & strNewIds objField.SetValue strSubtasks End If ' This function creates a new record and returns the new id Function CreateSubtask(nFId, strFTitle, strFDescription) Dim objNew Set objNew = Ext.CreateVarRecord(CHILD_TABLE_ID) call objNew.SetFieldValue("TITLE",strFTitle) call objNew.SetFieldValue("DESCRIPTION", strFDescription) call objNew.SetFieldValue(ITEM_TYPE_FLD,TASK_TYPE) call objNew.SetFieldValue(TASK_OWNER_FLD,nFId) call objNew.SetFieldValue("OWNER",nFId) call objNew.SetFieldValue(CHILD_SUBTASK_FLD,objItem.getid()) 'Set the system fields Call objNew.SetFieldValue("SUBMITDATE", Ext.DateToDBLong(now)) Call objNew.SetFieldValue("SUBMITTER", Shell.User.GetId()) Call objNew.SetFieldValue("LASTSTATECHANGER",Shell.User.GetId()) Call objNew.SetFieldValue("LASTSTATECHANGEDATE", Ext.DateToDBLong(now)) Call objNew.SetFieldValue("LASTMODIFIER", Shell.User.GetId()) Call objNew.SetFieldValue("LASTMODIFIEDDATE", Ext.DateToDBLong(now)) Call objNew.SetFieldValue("PROJECTID", PROJECT_ID) Call objNew.SetFieldValue("STATE", NEWSTATEID) Call objNew.SetFieldValue("CLOSEDATE", NULL) ' Create (add) the new record in the database. CreateSubtask = objNew.Add() End Function
'SBM' 카테고리의 다른 글
SBM with Gantt Chart (3) | 2011.12.13 |
---|---|
SBM AppScript Use Cases - 04. Subtask Time Calculation (0) | 2011.11.22 |
SBM AppScript Use Cases - 02. Calculate Work Effort Difference (0) | 2011.10.28 |
SBM AppScript Use Cases - 01. Validate Work Effort Fields (0) | 2011.10.28 |
Using Web Fonts to SBM (0) | 2011.08.25 |
Comments