I am currently developing an extension for Azure Devops to ensure the "Related Work" field is required upon submitting a work item. There is no current in-app support to make it required to add a parent link. My process involves changing a specific part of the HTML client-side upon the extension's load on the page to ensure the field is filled.
However, I am uncertain how this can be done since I've researched plenty only to come across examples where the jquery code to append data is on the same file as the HTML code being appended. I know that the extension script can directly interact with the window through the jquery command window
, but so far, the only command I've had success with is window.open("google.com")
. I've noticed there's plenty about $(document).ready(function() ...)
but it seems to only be about interacting directly with the html on the same file.
I was hoping there would be a way to just state window.document.getElementById('content').innerHTML
or something similar to that, but I've had no success.
I am using a JSON file and HTML file. Unfortunately, I cannot use the JSON property "content script" because I am not developing a Google Chrome extension.
If there are any other recommendations about this, I'd be very happy to hear about it! I was never able to find anything online about wanting to add a required field extension other than changing the XML which most likely wouldn't help since it doesn't seem to change the fields I need. But, since I am still very much a beginner in web development, I most likely may have missed something obvious.
Thank you for your help!
---Update---
I apologize for the messiness of the question. In summary, I am simply wanting to make the "Related Work" field on specific work item forms required. I was aware of the rules I could create, but unfortunately, the only field I could find was "Related Link Count", which upon use, doesn't seem to work.