Add `link` attribute to GlideElement when exists.
I'd like to include the link attribute in GlideElement when it exists to know if/when an element of a record is a link to another record. Some elements come with an additional attribute, link that points at the specific record.
I did check out the guess_is_sys_id which is usually enough to tell if it's a sys_id but would prefer to use the returned field when available.
I took a quick look to see what this would take, minimally something like:
-
the base API would need to make the
sysparm_exclude_reference_linkparam configurable. The default value should probably still be false so a quick check to see if it was set is probably enough. https://github.com/ServiceNow/PySNC/blob/1.1.8/pysnc/client.py#L151 -
the
GlideElementwould need to accept an optionallinkwhen adictis provided. Optionally an additional kwarg could be included but this might cause more grief for existing users. https://github.com/ServiceNow/PySNC/blob/1.1.8/pysnc/record.py#L32-L36 -
It might be worth adding some type of getter to the
GlideElementas well, again, if it's not going to impact users. Otherwise it looks like it would be included inserializeso that may be sufficient.
I think this could be relatively easily supported, and I agree with your assessment. Though the link attribute via API is 'new' to me as in I don't know/remember it so I'd have to look a little, assuming you weren't just going to send a PR
@vetsin I'm happy to open a PR; if you'd prefer to tackle it yourself just let me know how i can support.