Does it have to be 35 chars in length or will 13 suffice?
If the dynamic UUID generator is too long i tend to use a generator sourced via current timestamp in milliseconds.
I.e. ${=System.currentTimeMillis()} and this just generated the value of 1651104947608
Oh...all credit for this goes to nmrao....he showed me this.
If you want to continue using a UUID, we could put a bit of groovy together to strip out the hyphens from the UUID, but that'll require a separate groovy script (about 2 lines) rather than just using the dynamic scripting ${=path.to.method()} approach
Cheers,
Rich
","body@stringLength":"1062","rawBody":"Hey ,
Does it have to be 35 chars in length or will 13 suffice?
If the dynamic UUID generator is too long i tend to use a generator sourced via current timestamp in milliseconds.
I.e. ${=System.currentTimeMillis()} and this just generated the value of 1651104947608
Oh...all credit for this goes to ....he showed me this.
If you want to continue using a UUID, we could put a bit of groovy together to strip out the hyphens from the UUID, but that'll require a separate groovy script (about 2 lines) rather than just using the dynamic scripting ${=path.to.method()} approach
Cheers,
Rich
","author":{"__ref":"User:user:39914"},"isEscalated":null,"postTime":"2022-04-27T17:22:43.256-07:00","solution":false,"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"repliesCount":1},"Revision:revision:233208_1":{"__typename":"Revision","id":"revision:233208_1","lastEditTime":"2022-04-27T20:18:20.992-07:00"},"User:user:2985":{"__typename":"User","id":"user:2985","uid":2985,"login":"TNeuschwanger","biography":null,"registrationData":{"__typename":"RegistrationData","status":null,"registrationTime":"2007-10-22T09:59:16.000-07:00"},"deleted":false,"email":"","avatar":{"__typename":"UserAvatar","url":"https://community.smartbear.com/t5/s/nwkab66374/m_assets/avatars/default/avatar-11.svg?time=0"},"entityType":"USER","eventPath":"community:nwkab66374/user:2985"},"ModerationData:moderation_data:233207":{"__typename":"ModerationData","id":"moderation_data:233207","status":"APPROVED","rejectReason":null},"AcceptedSolutionMessage:message:233207":{"__typename":"AcceptedSolutionMessage","author":{"__ref":"User:user:2985"},"id":"message:233207","entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:233150/message:233207","revisionNum":3,"uid":233207,"depth":1,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:readyapi-questions"},"parent":{"__ref":"ForumTopicMessage:message:233150"},"conversation":{"__ref":"Conversation:conversation:233150"},"subject":"Re: How To Shorten the Length of a String Parameter","moderationData":{"__ref":"ModerationData:moderation_data:233207"},"body":"hello juliobello
\n
\nrichie pointed you in a good direction. You can actually put full groovy script into the ${= } syntax...
\n
\nHere is some groovy code that would work if it was in a groovy test step:
\n
\n
\ndef tmpUUID = java.util.UUID.randomUUID().toString();\ntmpUUID = tmpUUID.replaceAll(\"-\", \"\");\nreturn tmpUUID;
\n
\n
\n
\nYou can compress that and use it in place of your current dynamic property...
\n
\nInstead of:
\n
\n
\n${=java.util.UUID.randomUUID()}
\n
\n
\nTry:
\n
\n
\n${=def tmpUUID=java.util.UUID.randomUUID().toString();tmpUUID=tmpUUID.replaceAll(\"-\", \"\")}
\n
\n
\n
\nRegards,
\nTodd
","body@stripHtml({\"removeProcessingText\":true,\"removeSpoilerMarkup\":true,\"removeTocMarkup\":true,\"truncateLength\":200})@stringLength":"223","postTime":"2022-04-27T19:40:53.340-07:00","lastPublishTime":"2022-04-27T19:49:18.446-07:00","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"attachments":{"__typename":"AttachmentConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"solution":true,"metrics":{"__typename":"MessageMetrics","views":1940},"placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"videos":{"__typename":"VideoConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"isEscalated":null,"readOnly":false,"customFields":[]},"ModerationData:moderation_data:233209":{"__typename":"ModerationData","id":"moderation_data:233209","status":"APPROVED","rejectReason":null},"AcceptedSolutionMessage:message:233209":{"__typename":"AcceptedSolutionMessage","author":{"__ref":"User:user:91898"},"id":"message:233209","entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:233150/message:233209","revisionNum":1,"uid":233209,"depth":2,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:readyapi-questions"},"parent":{"__ref":"AcceptedSolutionMessage:message:233207"},"conversation":{"__ref":"Conversation:conversation:233150"},"subject":"Re: How To Shorten the Length of a String Parameter","moderationData":{"__ref":"ModerationData:moderation_data:233209"},"body":"Hi, Todd...
I did not know that one can actually put full groovy script into the ${= } syntax.
I already accepted Richie's response as a solution. I don't know if I can also \"accept\" your solution.
I am new to this \"groovy\" scripting language. For my edification, I am interested in knowing how to \"substring\" a string.
Where is the complete \"groovy\" scripting language library specification?
Thank-you for your response.
","body@stripHtml({\"removeProcessingText\":true,\"removeSpoilerMarkup\":true,\"removeTocMarkup\":true,\"truncateLength\":200})@stringLength":"218","postTime":"2022-04-27T20:27:47.233-07:00","lastPublishTime":"2022-04-27T20:27:47.233-07:00","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"attachments":{"__typename":"AttachmentConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"solution":true,"metrics":{"__typename":"MessageMetrics","views":2158},"placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"videos":{"__typename":"VideoConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"isEscalated":null,"readOnly":false,"customFields":[]},"ModerationData:moderation_data:233235":{"__typename":"ModerationData","id":"moderation_data:233235","status":"APPROVED","rejectReason":null},"AcceptedSolutionMessage:message:233235":{"__typename":"AcceptedSolutionMessage","author":{"__ref":"User:user:39914"},"id":"message:233235","entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:233150/message:233235","revisionNum":1,"uid":233235,"depth":3,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:readyapi-questions"},"parent":{"__ref":"AcceptedSolutionMessage:message:233209"},"conversation":{"__ref":"Conversation:conversation:233150"},"subject":"Re: How To Shorten the Length of a String Parameter","moderationData":{"__ref":"ModerationData:moderation_data:233235"},"body":"Hey juliobello,
For future reference if TNeuschwanger or nmrao or ChrisAdams or KarelHusa suggests stuff, id always go with their approaches rather mine cos my groovy skills bite.....the only reason i know any groovy is cos the above lads taught me!
I've switched the Accepted Solution from mine to Todd's as this is the better \"fix\" in this case (and Todd's actually taught me something new, so nice one for that!)
Cheers,
Rich
","body@stripHtml({\"removeProcessingText\":true,\"removeSpoilerMarkup\":true,\"removeTocMarkup\":true,\"truncateLength\":200})@stringLength":"203","postTime":"2022-04-28T08:10:40.963-07:00","lastPublishTime":"2022-04-28T08:10:40.963-07:00","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"attachments":{"__typename":"AttachmentConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"solution":true,"metrics":{"__typename":"MessageMetrics","views":2131},"placeholder":false,"showMoveIndicator":false,"originalMessageForPlaceholder":null,"videos":{"__typename":"VideoConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"isEscalated":null,"customFields":[]},"QueryVariables:ReplyList:message:233208:1":{"__typename":"QueryVariables","id":"ReplyList:message:233208:1","value":{"id":"message:233208","first":10,"sorts":{"kudosSumWeight":{"direction":"DESC","order":0},"postTime":{"direction":"ASC","order":1}},"repliesFirst":3,"repliesFirstDepthThree":1,"repliesSorts":{"kudosSumWeight":{"direction":"DESC","order":0},"postTime":{"direction":"ASC","order":1}},"useAvatar":true,"useAuthorLogin":true,"useAuthorRank":true,"useBody":true,"useKudosCount":true,"useTimeToRead":false,"useMedia":false,"useReadOnlyIcon":false,"useRepliesCount":true,"useSearchSnippet":false,"useAcceptedSolutionButton":true,"useSolvedBadge":false,"useAttachments":false,"attachmentsFirst":5,"useTags":false,"useNodeAncestors":false,"useUserHoverCard":false,"useNodeHoverCard":false,"useModerationStatus":true,"usePreviewSubjectModal":false,"useMessageStatus":true}},"CachedAsset:text:en_US-shared/client/components/users/UserAvatar-1749759144459":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserAvatar-1749759144459","value":{"altText":"{login}'s avatar","altTextGeneric":"User's avatar"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/ranks/UserRankLabel-1749759144459":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/ranks/UserRankLabel-1749759144459","value":{"altTitle":"Icon for {rankName} rank"},"localOverride":false},"CachedAsset:text:en_US-components/common/ExternalLinkWarningModal-1749759144459":{"__typename":"CachedAsset","id":"text:en_US-components/common/ExternalLinkWarningModal-1749759144459","value":{"title":"Leaving the Community","description":"You're about to leave this site and navigate to an external domain. Are you sure you want to continue?","action.submit":"Continue","action.cancel":"Go Back"},"localOverride":false},"CachedAsset:text:en_US-components/tags/TagView/TagViewChip-1749759144459":{"__typename":"CachedAsset","id":"text:en_US-components/tags/TagView/TagViewChip-1749759144459","value":{"tagLabelName":"Tag name {tagName}"},"localOverride":false},"CachedAsset:text:en_US-components/messages/AcceptedSolutionButton-1749759144459":{"__typename":"CachedAsset","id":"text:en_US-components/messages/AcceptedSolutionButton-1749759144459","value":{"accept":"Mark as Solution","accepted":"Marked as Solution","errorHeader":"Error!","errorAdd":"There was an error marking as solution.","errorRemove":"There was an error unmarking as solution.","solved":"Solved","topicAlreadySolvedErrorTitle":"Solution Already Exists","topicAlreadySolvedErrorDesc":"Refresh the browser to view the existing solution"},"localOverride":false},"CachedAsset:text:en_US-components/messages/ThreadedReplyList-1749759144459":{"__typename":"CachedAsset","id":"text:en_US-components/messages/ThreadedReplyList-1749759144459","value":{"title":"{count, plural, one{# Reply} other{# Replies}}","title@board:BLOG":"{count, plural, one{# Comment} other{# Comments}}","title@board:TKB":"{count, plural, one{# Comment} other{# Comments}}","title@board:IDEA":"{count, plural, one{# Comment} other{# Comments}}","title@board:OCCASION":"{count, plural, one{# Comment} other{# Comments}}","noRepliesTitle":"No Replies","noRepliesTitle@board:BLOG":"No Comments","noRepliesTitle@board:TKB":"No Comments","noRepliesTitle@board:IDEA":"No Comments","noRepliesTitle@board:OCCASION":"No Comments","noRepliesDescription":"Be the first to reply","noRepliesDescription@board:BLOG":"Be the first to comment","noRepliesDescription@board:TKB":"Be the first to comment","noRepliesDescription@board:IDEA":"Be the first to comment","noRepliesDescription@board:OCCASION":"Be the first to comment","messageReadOnlyAlert:BLOG":"Comments have been turned off for this post","messageReadOnlyAlert:TKB":"Comments have been turned off for this article","messageReadOnlyAlert:IDEA":"Comments have been turned off for this idea","messageReadOnlyAlert:FORUM":"Replies have been turned off for this discussion","messageReadOnlyAlert:OCCASION":"Comments have been turned off for this event"},"localOverride":false}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"readyapi-questions","messageSubject":"how-to-shorten-the-length-of-a-string-parameter","messageId":"233150","replyId":"233208"},"buildId":"3XH0qYWYCnEYycuN5W4S8","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","surveysEnabled":true,"openTelemetry":{"clientEnabled":false,"configName":"smartbear","serviceVersion":"25.4.0","universe":"prod","collector":"http://localhost:4318","logLevel":"error","routeChangeAllowedTime":"5000","headers":"","enableDiagnostic":"false","maxAttributeValueLength":"4095"},"apolloDevToolsEnabled":false,"quiltLazyLoadThreshold":"3"},"isFallback":false,"isExperimentalCompile":false,"dynamicIds":["components_seo_QAPageSchema","components_community_Navbar_NavbarWidget","components_community_Breadcrumb_BreadcrumbWidget","components_messages_TopicWithThreadedReplyListWidget","components_messages_MessageListForNodeByRecentActivityWidget","components_messages_RelatedContentWidget","components_customComponent_CustomComponent","components_messages_MessageView_MessageViewStandard","components_messages_EscalatedMessageBanner","shared_client_components_common_List_UnstyledList","components_messages_MessageView","components_messages_MessageView_MessageViewInline","shared_client_components_common_Pager_PagerLoadMore","components_customComponent_CustomComponentContent_TemplateContent","shared_client_components_common_List_UnwrappedList","components_tags_TagView","components_tags_TagView_TagViewChip"],"appGip":true,"scriptLoader":[]}