We use a python script to transition issues through some interaction with our build system. The workflow is like this: an issue is sent to an Enqueued status, the build machine queries a building project for its Enqueued issues, transitions them to a reserved status while they build, and then transitions them toward QA once they're built.
Our python script manages manages these transitions and also adds a comment with the appropriate build number.
It would be more useful for us if we updated a custom field with the fix build number. However, we ran into an issue implementing this in our python script: it appears as though the custom field can't be accessed or updated.
We were trying to update our custom field using these instructions:
issue.update(fields={'customfield_11900': arg.buildnumber})
Eventually, this worked:
issue.update(fields={'customfield_11900': int(args.buildnumber)})
Syntax for args may have been a problem, and we also found that we needed to cast the argument string as an int.
Hope this helps someone with a similar issue!
Tnx! it really helped when I needed to construct the customfield tag also (the ID number was known) when updating number custom field:
CFIELD=10127
fieldtag="customfield_"+CFIELD
myvalue=12345
mydict = {'{0}'.format(fieldtag): int(myvalue)}
issue.update(fields=mydict)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What type of field is it? I knwo you've said you've got the field on-screen in every point in the workflow, but could you also check the "edit" screen for the issue type?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Number field, Global to all issue types, and I did have it on our default screen when we were looking at this. For reference, I used the same configuration as a Label field which is successfully retrieved (but not updated) by the same script.
The Edit Screen is declared in the Screen Scheme, right? That appears to be correctly configured for what we're doing (the field is present on screens associated with the issue type).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, my worry was that it might be a read-only field, or one that disallows edits for some reason. Plus, if it's not on the "Edit" screen, then REST might not have been able to get to it as it respects the ui settings.
I'm afraid I'm stuck, as your code looks like it really should be working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.