updated db schema def

This commit is contained in:
2025-07-22 11:34:56 -04:00
parent a6f4a89b47
commit 3c35e7f60c
515 changed files with 272693 additions and 0 deletions

View File

@@ -0,0 +1 @@
{"RootPath":"D:\\DTS\\Code\\CCNetLogReader\\ZendeskTickets","ProjectFileName":"ZendeskTickets.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Properties\\Settings1.Designer.cs"},{"SourceFile":"Settings1.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.5.2.AssemblyAttributes.cs"}],"References":[{"Reference":"D:\\DTS\\Code\\CCNetLogReader\\FogbugzWrapper\\bin\\Debug\\FogbugzWrapper.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":true,"ProjectPath":"D:\\DTS\\Code\\CCNetLogReader\\FogbugzWrapper\\bin\\Debug\\FogbugzWrapper.dll"},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.5.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\DTS\\Code\\CCNetLogReader\\ZendeskTickets\\bin\\Debug\\ZendeskTickets.exe","OutputItemRelativePath":"ZendeskTickets.exe"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="ZendeskTickets.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="ZendeskTickets.Properties.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="ZendeskTickets.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<userSettings>
<ZendeskTickets.Settings1>
<setting name="CurrentToken" serializeAs="String">
<value />
</setting>
</ZendeskTickets.Settings1>
</userSettings>
<applicationSettings>
<ZendeskTickets.Properties.Settings1>
<setting name="ManuscriptServerAddress" serializeAs="String">
<value>manuscript.dts.local</value>
</setting>
</ZendeskTickets.Properties.Settings1>
<ZendeskTickets.Settings1>
<setting name="DebugLogging" serializeAs="String">
<value>False</value>
</setting>
<setting name="PublishResultsToZendesk" serializeAs="String">
<value>True</value>
</setting>
</ZendeskTickets.Settings1>
</applicationSettings>
</configuration>

View File

@@ -0,0 +1,115 @@
using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZendeskTickets
{
internal class Program
{
private const string TIMESTAMP_FILE = "lastRunTime.txt";
private const string OUTPUT_SEPERATOR = "========================";
private const string SINGLE_TAB = " ";
static void Main(string[] args)
{
FogbugzWrapper.FogbugzClient fogbugzClient;
if (string.IsNullOrEmpty(Settings1.Default.CurrentToken) && args.Length != 2)
{
Console.WriteLine("No Login Credentials!");
Console.ReadKey();
return;
}
else if(!string.IsNullOrEmpty(Settings1.Default.CurrentToken))
{
fogbugzClient = new FogbugzWrapper.FogbugzClient($@"http://{Properties.Settings1.Default.ManuscriptServerAddress}/api.asp?", Settings1.Default.CurrentToken);
}
else
{
fogbugzClient = new FogbugzWrapper.FogbugzClient($@"http://{Properties.Settings1.Default.ManuscriptServerAddress}/api.asp?", args[0], args[1]);
}
if (fogbugzClient == null)
{
Console.WriteLine($"Login failed for user:{args[0]}");
return;
}
Settings1.Default.CurrentToken = fogbugzClient.Token;
Settings1.Default.Save();
var loggedin = fogbugzClient.IsLoggedIn();
if (!loggedin) { Console.WriteLine($"ERROR: NOT LOGGED IN"); Console.ReadKey(); return; }
var zdCaseCount = 0;
var timeNow = DateTime.Now;
Console.WriteLine($"{timeNow.ToString()} Searching for ZD cases...");
int timeDeltaMinutes = 60;
if (File.Exists(TIMESTAMP_FILE))
{
timeDeltaMinutes = (int)(timeNow - DateTime.Parse(File.ReadAllText(TIMESTAMP_FILE))).TotalMinutes;
}
if (Settings1.Default.PublishResultsToZendesk)
{
File.WriteAllText(TIMESTAMP_FILE, timeNow.ToString());
}
var allZendeskCases = fogbugzClient.GetZendeskCases(timeDeltaMinutes);
if (allZendeskCases?.FirstOrDefault() == null)
{
Console.WriteLine($"ERROR: No Zendesk Cases.");
return;
}
else
{
var sb = new StringBuilder();
foreach (var zendeskCase in allZendeskCases
.OrderBy(x=>x.TimeStamp)
)
{
var comment = string.IsNullOrEmpty(zendeskCase.LatestEvent.Comment) ? "<no comment>" : $"{zendeskCase.LatestEvent.Comment}";
sb.AppendLine($"{Environment.NewLine}{SINGLE_TAB}ZD:{zendeskCase.ZendeskNumber}");
var zdfbMapping = "Automatic Update from Manuscript:" +
$"\\nMS Case:\\t\\t\\thttp://{Properties.Settings1.Default.ManuscriptServerAddress}/f/cases/{zendeskCase.FogbugzNumber}" +
$"\\nEventStatus:\\t\\t\\t{zendeskCase.LatestEvent.StatusString}" +
$"\\nTimestamp (PT):\\t\\t\\t{zendeskCase.TimeStamp}" +
$"\\nUser:\\t\\t\\t\\t{zendeskCase.LatestEvent.User}" +
$"\\nReleaseNote:\\t\\t{zendeskCase.LatestEvent.ReleaseNote}" +
$"\\nComment:" +
$"\\n{comment}";
sb.AppendLine(zdfbMapping);
var completeUpdate = string.Format("{{\"ticket\": {{\"comment\": {{ \"body\": \"{0}\", \"public\": false}} }} }}", zdfbMapping);
sb.AppendLine($"{Environment.NewLine}{OUTPUT_SEPERATOR}");
#region curl
if (Settings1.Default.PublishResultsToZendesk)
{
var curl = new System.Diagnostics.Process();
curl.StartInfo.FileName = "RunCurl.cmd";
var TempFileName = Path.GetTempFileName();
using (var sw = new StreamWriter(TempFileName))
{
sw.WriteLine(completeUpdate);
}
curl.StartInfo.Arguments = $"{zendeskCase.ZendeskNumber} {TempFileName}";
curl.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Minimized;
curl.Start();
curl.WaitForExit();
}
#endregion
zdCaseCount++;
}
if (Settings1.Default.DebugLogging)
{
File.WriteAllText($"ZendeskTickets.{timeNow.ToString("yyMMdd.hhmmss")}.log", sb.ToString());
Console.Write(sb.ToString());
}
Console.WriteLine($"{DateTime.Now.ToString()} Done!" +
$"{Environment.NewLine}{SINGLE_TAB}Total Cases: {allZendeskCases.Count}" +
$"{Environment.NewLine}{SINGLE_TAB}Updated: {zdCaseCount}" +
$"{Environment.NewLine}{OUTPUT_SEPERATOR}" +
$"{Environment.NewLine}{OUTPUT_SEPERATOR}");
}
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ZendeskTickets")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("VPG")]
[assembly: AssemblyProduct("ZendeskTickets")]
[assembly: AssemblyCopyright("Copyright © VPG 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3761cf6e-7a65-4d28-9c02-0afd08093876")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,35 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ZendeskTickets.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.13.0.0")]
internal sealed partial class Settings1 : global::System.Configuration.ApplicationSettingsBase {
private static Settings1 defaultInstance = ((Settings1)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings1())));
public static Settings1 Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("manuscript.dts.local")]
public string ManuscriptServerAddress {
get {
return ((string)(this["ManuscriptServerAddress"]));
}
}
}
}

View File

@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="ZendeskTickets.Properties" GeneratedClassName="Settings1">
<Profiles />
<Settings>
<Setting Name="ManuscriptServerAddress" Type="System.String" Scope="Application">
<Value Profile="(Default)">manuscript.dts.local</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -0,0 +1,56 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ZendeskTickets {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.12.0.0")]
internal sealed partial class Settings1 : global::System.Configuration.ApplicationSettingsBase {
private static Settings1 defaultInstance = ((Settings1)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings1())));
public static Settings1 Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string CurrentToken {
get {
return ((string)(this["CurrentToken"]));
}
set {
this["CurrentToken"] = value;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool DebugLogging {
get {
return ((bool)(this["DebugLogging"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool PublishResultsToZendesk {
get {
return ((bool)(this["PublishResultsToZendesk"]));
}
}
}
}

View File

@@ -0,0 +1,15 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="ZendeskTickets" GeneratedClassName="Settings1">
<Profiles />
<Settings>
<Setting Name="CurrentToken" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="DebugLogging" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="PublishResultsToZendesk" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3761CF6E-7A65-4D28-9C02-0AFD08093876}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ZendeskTickets</RootNamespace>
<AssemblyName>ZendeskTickets</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings1.settings</DependentUpon>
</Compile>
<Compile Include="Settings1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings1.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="Properties\Settings1.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings1.Designer.cs</LastGenOutput>
</None>
<None Include="Settings1.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings1.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FogbugzWrapper\FogbugzWrapper.csproj">
<Project>{4a6b9d30-da78-4bfe-b7cd-38774be0508f}</Project>
<Name>FogbugzWrapper</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>
</StartArguments>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1 @@
curl.exe https://dtsweb.zendesk.com/api/v2/tickets/%1.json --data "@%2" -H "Authorization: Bearer b78fb2a22c1851af4c835f6f8af1b8d586598b324fb15539e37d4fac13fd72b2" -X PUT -H "Content-Type: application/json" -k

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
curl.exe https://dtsweb.zendesk.com/api/v2/tickets/%1.json --data "@%2" -H "Authorization: Bearer b78fb2a22c1851af4c835f6f8af1b8d586598b324fb15539e37d4fac13fd72b2" -X PUT -H "Content-Type: application/json" -k

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5.2", FrameworkDisplayName = ".NET Framework 4.5.2")]