Skip to content

Conversation

@Shubhangi-cs
Copy link
Contributor

@Shubhangi-cs Shubhangi-cs commented Jun 20, 2025

Issue: for fields of type glide_time in ServiceNow, when the value is retrieved using the actual value type, it is returned in a glide_datetime format. This causes a parsing failure, as the expected format for glide_time is not maintained. However, when using the display value type, the value is correctly returned as glide_time.

Root Cause: ServiceNow automatically prefixes a default date to glide_time values when accessed via the actual value type, converting it to datetime format.

Fix: implemented explicit handling to map glide_time fields to datetime when using the actual value type.

JIRA Ticket: https://cdap.atlassian.net/browse/PLUGIN-1901

@Shubhangi-cs Shubhangi-cs force-pushed the bugfix/time_dataType branch from ec75721 to 3dc91fb Compare June 23, 2025 07:05
@Shubhangi-cs Shubhangi-cs force-pushed the bugfix/time_dataType branch from 3dc91fb to d1b43ad Compare June 24, 2025 08:44
@Shubhangi-cs Shubhangi-cs changed the title "Time datatype support for actual value type" "[PLUGIN-1901] Time datatype support for actual value type" Jun 24, 2025
@MrRahulSharma MrRahulSharma self-requested a review June 24, 2025 09:53
@Sunish-Dahiya
Copy link

Can you please add more details(What and Why, testing details) in the description. Also e2e tests are failing for this PR

@Shubhangi-cs
Copy link
Contributor Author

Can you please add more details(What and Why, testing details) in the description. Also e2e tests are failing for this PR

Added, working on e2e

columns.add(new ServiceNowColumn(field.getName(), field.getType()));
} else if (valueType.equals(SourceValueType.SHOW_ACTUAL_VALUE) &&
"glide_time".equalsIgnoreCase(field.getInternalType())) {
columns.add(new ServiceNowColumn(field.getName(), "datetime"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be glide_date_time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

case "glide_date":
return Schema.of(Schema.LogicalType.DATE);
case "glide_date_time":
case "datetime":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be omitted. As, we can use glide_date_time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

!Objects.equals(field.getType(), field.getInternalType())) {
columns.add(new ServiceNowColumn(field.getName(), field.getType()));
} else if (valueType.equals(SourceValueType.SHOW_ACTUAL_VALUE) &&
"glide_time".equalsIgnoreCase(field.getInternalType())) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move "glide_time" to constants

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

columns.add(new ServiceNowColumn(field.getName(), field.getType()));
} else if (valueType.equals(SourceValueType.SHOW_ACTUAL_VALUE) &&
"glide_time".equalsIgnoreCase(field.getInternalType())) {
columns.add(new ServiceNowColumn(field.getName(), "glide_date_time"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Shubhangi-cs Shubhangi-cs force-pushed the bugfix/time_dataType branch from f6ce966 to cdcd55d Compare July 7, 2025 05:51
private static final String FIELD_CREATED_ON = "sys_created_on";
private static final String FIELD_UPDATED_ON = "sys_updated_on";
private static final String OAUTH_URL_TEMPLATE = "%s/oauth_token.do";
private static final String GLIDE_TIME = "glide_time";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit]: Adding a DATA_TYPE as prefix or suffix would make it more readable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Shubhangi-cs Shubhangi-cs force-pushed the bugfix/time_dataType branch from cdcd55d to b636e77 Compare July 7, 2025 06:05
@Shubhangi-cs Shubhangi-cs merged commit 4dbb964 into data-integrations:develop Jul 7, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants