// DidIssueChange tests each of the relevant fields on the provided JIRA and GitHub issue
// and returns whether or not they differ.
DidIssueChange tests each of the relevant fields on the provided JIRA and GitHub issue
and returns whether or not they differ.
// DidIssueChange tests each of the relevant fields on the provided JIRA and GitHub issue // and returns whether or not they differ .
func DidIssueChange(config cfg.Config, ghIssue github.Issue, jIssue jira.Issue) bool {
	log := config.GetLogger()
	log.Debugf("Comparing GitHub issue #%d and JIRA issue %s", ghIssue.GetNumber(), jIssue.Key)
	anyDifferent := false
	anyDifferent = anyDifferent || (ghIssue.GetTitle() != jIssue.Fields.Summary)
	anyDifferent = anyDifferent || (ghIssue.GetBody() != jIssue.Fields.Description)
	key := config.GetFieldKey(cfg.GitHubStatus)
	field, err := jIssue.Fields.Unknowns.String(key)
	if err != nil || *ghIssue.State != field {
		anyDifferent = true
	}
	key = config.GetFieldKey(cfg.GitHubReporter)
	field, err = jIssue.Fields.Unknowns.String(key)
	if err != nil || *ghIssue.User.Login != field {
		anyDifferent = true
	}
	labels := make([]string, len(ghIssue.Labels))
	for i, l := range ghIssue.Labels {
		labels[i] = *l.Name
	}
	key = config.GetFieldKey(cfg.GitHubLabels)
	field, err = jIssue.Fields.Unknowns.String(key)
	if err != nil && strings.Join(labels, ",") != field {
		anyDifferent = true
	}
	log.Debugf("Issues have any differences: %b", anyDifferent)
	return anyDifferent
}
func DidIssueChange ( config cfg . Config , ghIssue github . Issue , jIssue jira . Issue ) bool { log := config . GetLogger ( ) log . Debugf ( " " , ghIssue . GetNumber ( ) , jIssue . Key ) anyDifferent := false anyDifferent = anyDifferent || ( ghIssue . GetTitle ( ) != jIssue . Fields . Summary ) anyDifferent = anyDifferent || ( ghIssue . GetBody ( ) != jIssue . Fields . Description ) key := config . GetFieldKey ( cfg . GitHubStatus ) field , err := jIssue . Fields . Unknowns . String ( key ) if err != nil || * ghIssue . State != field { anyDifferent = true } key = config . GetFieldKey ( cfg . GitHubReporter ) field , err = jIssue . Fields . Unknowns . String ( key ) if err != nil || * ghIssue . User . Login != field { anyDifferent = true } labels := make ( [ ] string , len ( ghIssue . Labels ) ) for i , l := range ghIssue . Labels { labels [ i ] = * l . Name } key = config . GetFieldKey ( cfg . GitHubLabels ) field , err = jIssue . Fields . Unknowns . String ( key ) if err != nil && strings . Join ( labels , " " ) != field { anyDifferent = true } log . Debugf ( " " , anyDifferent ) return anyDifferent }
DidIssueChange tests each of the relevant fields on the provided JIRA and GitHub issue
and returns whether or not they differ.
DidIssueChange tests each of the relevant fields on the provided JIRA and GitHub issue and returns whether or not they differ .