2016-11-22 5 views
1

다음과 같이 code을 사용하여 HP ALM 12.5 (ALM Connectivity - OTA 사용)에서 프로젝트를 내보낼 수 있습니다. 현재, 다음 줄에서 오류가 발생합니다. sa.ExportProject v_domain, v_project, v_fileName 오류 메시지 : "런타임 오류 '-2147220350 (80040482) : 잘못된 서버 응답 [ERR-SEP]이 오류를 해결하기위한 피드백은 . 알 수 HP ALM Connectivity OTA - 프로젝트 내보내기 오류

미리 감사드립니다 여기

코드입니다 :..

Sub ALM_Backup() 

Dim v_qcURL, sa, v_username, v_pasword 
Dim v_domain, v_project, v_date, v_fileName, bugId, v_summary 
Dim v_projectList, v_domainProject, v_domainProjectArray 

' The following code is to move the existing files from to source to destination folder 

Dim fso 
Dim sfol As String 
Dim dfol As String 

sfol = "C:\ALM Backup" 
dfol = "C:\ALM Backup Archive" 

Set fso = CreateObject("Scripting.FileSystemObject") 

fso.MoveFile (sfol & "\*.*"), dfol 'Change "\*.*" to "\*.qcp" 


v_qcURL = "https://qcurl" 
v_projectList = "Domain1:Project1;Domain2:Project2;Domain3:Project3" 


v_username = "userid" 
v_password = "password" 

For Each v_domainProject In Split(v_projectList, ";") 

v_domainProjectArray = Split(v_domainProject, ":") 
v_domain = v_domainProjectArray(0) 
v_project = v_domainProjectArray(1) 

v_year = Year(Now) 
v_month = Month(Now) 
v_day = Day(Now) 
v_hour = Hour(Now) 
v_minute = Minute(Now) 
v_second = Second(Now) 

If v_month < 10 Then 
    v_month = "0" & v_month 
End If 
If v_day < 10 Then 
    v_day = "0" & v_day 
End If 
If v_hour < 10 Then 
    v_hour = "0" & v_hour 
End If 
If v_minute < 10 Then 
    v_minute = "0" & v_minute 
End If 
If v_second < 10 Then 
    v_second = "0" & v_second 
    End If 


v_date = v_year & v_month & v_day & v_hour & v_minute & v_second 

    v_fileName = "C:\ALM_Backup" & v_date & "_" & v_project & ".qcp" 
v_summary = "For project <" & v_domainProject & "> backup started: " & v_date 

bugId = openDefect(v_summary) 

Set sa = CreateObject("SAClient.SaApi") 
sa.Login v_qcURL, v_username, v_password 


sa.SendAllQualifiedNow "IT", "QA_Internal_Projects" 
sa.SendMessageToProjectConnectedUsers v_domain, v_project, "This project is going to be deactivated due to maintenence." 
sa.DisconnectProject v_domain, v_project 
sa.DeactivateProject v_domain, v_project 
sa.ExportProject v_domain, v_project, v_fileName 
sa.ActivateProject v_domain, v_project 

Set fs = CreateObject("Scripting.FileSystemObject") 
Set f = fs.GetFile(v_fileName) 

fixAndCloseDefect bugId, v_fileName & ": " & Round((f.Size/1024)/1024, 2) & " MB" 
sa.SendAllQualifiedNow "IT", "QA_Internal_Projects" 
Next 

sa.Logout 

End Sub 


Function openDefect(p_summary) 
v_detectionDate = Day(Now) & "." & Month(Now) & "." & Year(Now) 
If Day(Now) < 10 Then 
    v_detectionDate = "0" & Day(Now) & "." & Month(Now) & "." & Year(Now) 
End If 
If Month(Now) < 10 Then 
    v_detectionDate = Day(Now) & ".0" & Month(Now) & "." & Year(Now) 
End If 
If Month(Now) < 10 And Day(Now) < 10 Then 
    v_detectionDate = "0" & Day(Now) & ".0" & Month(Now) & "." & Year(Now) 
End If 

Set tdc = CreateObject("TDApiOle80.TDConnection") 
tdc.InitConnectionEx "http://qcurl" 
tdc.Login "userid", "password" 
tdc.Connect "IT", "QA_Internal_Projects" 


Set bfact = tdc.BugFactory 

Set mybug = bfact.AddItem(Null) 
mybug.Summary = p_summary 
mybug.Status = "Open" 
mybug.Field("BG_SEVERITY") = "2-Medium" 
mybug.DetectedBy = "userid" 
mybug.Field("BG_DETECTION_DATE") = Date 
mybug.Post 
bugId = mybug.ID 
tdc.Logout 
tdc.Disconnect 
openDefect = bugId 
End Function 

Function fixAndCloseDefect(p_bugId, p_comment) 
Set tdc = CreateObject("TDApiOle80.TDConnection") 
tdc.InitConnectionEx "https://qcurl" 
tdc.Login "userid", "passsword" 
tdc.Connect "IT", "QA_Internal_Projects" 

Set bfact = tdc.BugFactory 
    Set bgfilter = bfact.Filter 

    bgfilter.Filter("BG_BUG_ID") = p_bugId 
    Set bglist = bgfilter.NewList 

For Each theBug In bglist 
    Set bg = bfact.Item(theBug.ID) 
    bg.Field("BG_STATUS") = "Closed" 
    bg.Field("BG_DEV_COMMENTS") = "Backup completed on <backup_host>: " &  p_comment 
    bg.Post 
Next 

tdc.Logout 
tdc.Disconnect 
End Function 

답변

0

내가 오류를 해결 한 코드는 지금 좋은 실행 .qcp 파일로 ALM 프로젝트를 수출

.

다음과 같습니다. 그것이 어떻게 풀 렸는지.

난 그냥 그것이 이전에 슬래시

을 가지고 v_fileName 변수를 변경 :

v_fileName = "C:\ALM_Backup" & v_date & "_" & v_project & ".qcp" 

이 변경에 : 오류가 새로 추가하지 않고 있기 때문에 무슨 일이 벌어지고

v_fileName = "C:\ALM_Backup\" & v_date & "_" & v_project & ".qcp" 

이유 "ALM_Backup"뒤에 백 슬래시가 있으면 프로그램이 C : \ ALM_Backup 디렉토리가 아닌 C 디렉토리에 파일을 저장하려고했습니다.