Skip to content

Commit

Permalink
time update
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshishikha committed Sep 11, 2024
1 parent 08fdec7 commit 5b8c45e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 13 additions & 3 deletions july2024august2024/jiraDetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,23 @@ func performJiraDetailsTransition(prodDgraphClient, expDgraphClient graphql.Clie
return fmt.Errorf("error: getJiraTicketDetails: %s", err.Error())
}

currTime := time.Now()
layout := "2006-01-02T15:04:05.000-0700"
createdAt, err := time.Parse(layout, ticketDetails.Fields.Created)
if err != nil {
return fmt.Errorf("error: time.Parse: for created at %s", err.Error())
}

updatedAt, err := time.Parse(layout, ticketDetails.Fields.Updated)
if err != nil {
return fmt.Errorf("error: time.Parse: for updated at %s", err.Error())
}

entryDetails := august2024.AddJiraInput{
JiraId: ticketDetails.Id,
Url: jiraTicketUrl,
Status: ticketDetails.Fields.Status.Name,
CreatedAt: &currTime,
UpdatedAt: &currTime,
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
AffectsIndividualComponent: &august2024.RunHistoryRef{
Id: eachRunHistory.Id,
},
Expand Down
6 changes: 4 additions & 2 deletions july2024august2024/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ type JiraIssueDetails struct {
Id string `json:"id,omitempty" yaml:"id,omitempty"`
Key string `json:"key,omitempty" yaml:"key,omitempty"`
Fields struct {
Labels []string `json:"labels,omitempty" yaml:"labels,omitempty"`
Status struct {
Created string `json:"created,omitempty" yaml:"created,omitempty"`
Updated string `json:"updated,omitempty" yaml:"updated,omitempty"`
Labels []string `json:"labels,omitempty" yaml:"labels,omitempty"`
Status struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
} `json:"status,omitempty" yaml:"status,omitempty"`
} `json:"fields,omitempty" yaml:"fields,omitempty"`
Expand Down

0 comments on commit 5b8c45e

Please sign in to comment.