JIRA gadget: how to disable a configuration field - jira

Is there a way to disable a configuration field for a JIRA gadget based on the value of another field?
Example: when the user chooses 'Now' for field Foo, then the Date field is ignored. I'd like to disable the Date field. Can this be done? If so, how? I already do the ignoring part. But my only clue for the user that I am ignoring the Date field is my description for Date and Foo. It would be nicer to disable the Date field as well.

If you want to do anything other than use the built-in gadget controls with their standard behaviors, you need to implement your own gadget configuration code instead of relying on the UserPrefs directly.
This means that, in practice, that you need to omit the "configuration form" from your gadget descriptor, which is this part:
config: {
descriptor: function(){...},
args: {Function, Array}
},
After having removed that, your gadget will then need to build its own UI and decide itself whether or not it still needs to be configured, as well as call gadget.getPref() and gadget.savePref() to get/set your user's gadget configuration options in the parent container.
I should add that this is a fair amount of work. You might be able to do some hacky jQuery to override the standard controls built without doing the above, but this will not likely be portable to different parent containers (or even different versions of JIRA).

Related

"[Me]" variable for custom field alerts in TFS 2013

I added a custom field (Test Prime) in TFS. Since I wanted a drop down of valid TFS users, I copied the setup of the Assigned To control (String, Dimension, ALLOWEXISTINGVALUE, VALIDUSER, and SYNCNAMECHANGES). I want to be able to set up an alert triggered when:
Test Prime Changes to [Me] or Test Prime Changes from [Me]
but "[Me]" or "#Me" does not seem to grab the current user. It's under the drop down menu of Assigned To so I don't see why I can't get access to this variable. Is it because this is for a non-core field and [Me] is only available for core fields? If yes, is there a workaround because I haven't been able to find any.
set the syncnamechanges="true" in the custom field definition. If the workitem template cannot be uploaded, use the witadmin tool to update the syncnamechanges attribute.
in the alert rule, use ##MyDisplayName## placeholder instead of [Me] or #Me.

Search Version jira rest api

I need to get all issues by version id. My query is like:
http://archwork:2990/jira/rest/api/2/search\?jql\=project\=GP+and+fixVersion\=10001
working fine, but I want to get issues by VERSION
Link like:
http://archwork:2990/jira/rest/api/2/search\?jql\=project\=GP+and+version\=10001
returned "Field 'version' does not exist or you do not have permission to view it."
The two built-in version fields in JIRA can be accessed in JQL as fixVersion and affectedVersion. I suspect that you want the latter.
If you have another custom field (which is a version-type field) that you want to query, the error message suggests that you may not be using the correct name for it. The best way to check this is to type your JQL into JIRA's Issue Navigator manually (in the advanced search) and to take advantage of the dropdown box with field name suggestions to get the correct field name.
One way to bypass the problem of determining the correct JQL field name (which sometimes requires quoting, which gets slightly more messy if you are also URL-encoding the result) is to simply refer to a field by the custom field ID instead.
You can find the CF ID of a field by going to Admin->Issues->Custom Fields, finding the appropriate custom field, mousing over the "Configure" link, and then looking at the URL query parameter for customFieldId, and then use the syntax cf[xxxxxx] in your JQL instead of the field name, where xxxxxx is the custom field number.

TFS 2013 - Description HTML Field Can't Be Required

Fellow TFS users and/or junkies,
We are using TFS 2013. When I add required for Description HTML (Microsoft.VSTS.Common.DescriptionHTML), the default value still shows up as "As a I want so that ", THUS it doesn't require the user to fill anything in and it doesn't show up yellow. Sure, I could change the field, but we already have many things linked to Description HTML and can't risk changing the fields (reports and such are already setup). How would I change this so either:
A. It is empty and will show up required OR
B. It requires the user to change the value
Things I tried:
Setting the value to empty. Won't allow me to have both empty AND required.
Setting Default Value to empty. Won't allow me to that either.
Setting Prohibited Values to the default text it has. Not allowed for the field.
Applying a WhenNotChanged rule for the field and setting it to required. It already has a value so it doesn't matter if it's required or not.
I've just looked into a similar tfs machine.
It's just a defined "Default" rule but not in the "Fields" tab but in workflow tab.
In my case, it was in the initial transition rule.
To be specific:
Like you can guess, using Power Tools;
open the work item
go to the "Workflow" tab.
In the designer, double click the (most possibly) first transition element to view its settings
In the window opened, go to the "Fields" tab
If you see "Description" field there, double click it
Remove the "Default" rule
Now, you don't have a default text. You can set it "Required" and it'll be ok.
Close all, go to Fields tab of work item and set a required rule in a way as you expected initially.

How can I add text to a work item

We have a few bugs and change requests which have a complicated iteration path. This results in people coming over the team to ask 'Where do we raise items' a lot.
As you can't set a default value for the iteration path in TFS 2010 we think the best solution would be to add a string of text under the field which we can manually update every 7 weeks with the correct area to raise items in.
However TFS doesn't seem to allow just a line of text on its work items as a control. Is there a way to add a line of display text i.e. Not a field you edit, but just to inform those writing the items?
Please note that it needs to be visible at all times, using the tooltip 'help text' field on a control is not enough in this case.
You can use the LabelControl for this purpose.
You can not have a default in the work item for the iteration path, but what you can do is making use or the template url in web access or the work item templates in the power tools to create a work item that is prepopulated with values.
What about a custom field with a display control in read-only? You can give a default value to the field and the "read-only" control prevent other to change it.

Sharepoint Make a custom list read only

I have created a custom list. I am using the same list in sharepoint designer through a page.
I a have a datetime field in the form. I want to make a default current date and time and let it make readonly.
How can I do the same.
thanks
As I understood you, you want to set custom permissions on a date field (column) in a custom list. Sharepoint 2007 does not allow column-level security via the UI as far as I know.
If you deployed the list definition via Feature you can set the site columns to be read-only by setting the field to read only via its column definitions like so:
Hidden="FALSE" ReadOnly="TRUE" Required="FALSE" PITarget="" PrimaryPITarget="" PIAttribute="" PrimaryPIAttribute="" Node=""
An easier solution is to use third party tools such as the Sharepoint Tool Basket. It has a feature called "List Manager" which allows you to set columns to read-only if it's not a system column - see the codeplex site for screenshots.
As for your datetime field having the date of Today, you can just create a new Site Column of type Date/Time and set its default value to be "Today".
So the easiest solution would be: Install the List Manager and activate the feature for your site. Create a new site column "Today" of type Date/Time with default value set to Today. Afterwards set the site column to read-only via the List Manager.

Resources